Problem with select_polygon in Gimp 2.99

I am now using the latest flatpak commit 9ab4816 of Gimp 2.99.19. Previously I have been able to make a polygon selection with code like

Polygon

    segs = [300, 550, 350, 600, 400, 550, 500, 650, 400, 600, 400, 650, 300, 600]
    num_segs = len(segs)  # not required by Python
    new_image.select_polygon(Gimp.ChannelOps.REPLACE, segs)
    new_layer.edit_fill(Gimp.FillType.FOREGROUND)

This now crashes Gimp with a message “Stack smashing detected” which usually indicates a buffer overflow. I have not reported this as a bug becase I suspect it is not one. Something has changed in the API and I just need to know how it now needs to be coded. Help please!

This works just fine on my local build, but this error message bothered me, so I just installed the nightly flatpak and I could reproduce there.

Something did change in the API but it should not result in GIMP crashing! No plug-in code ever should crash GIMP. If this happens, there is a clear bug in GIMP, so we welcome bug reports!

After the API change which happened, existing plug-in code may be broken, sure, but that’s all.

Anyway I’ll want to have a closer look.

Ok so I could reproduce (building with clang instead of gcc and with specific build flags).

I was scared that I messed up something in the new API architecture. Fortunately it was just a local bug, which is now fixed.

I also triggered a nightly flatpak build in advance (approaching RC1 release, let’s go more “proactive” on test builds :wink:) so hopefully you should be update in a few hours with the fix and confirm it’s all good for you too!

Thanks for the report!

Thnk you very much for sorting this. I have now updated to 00753ef and can confirm that this has cleared the problem. All best wishes for RC1 !

1 Like