GNOME Bugzilla – Bug 364429
Filmstrip plugin crashes
Last modified: 2008-01-15 14:09:32 UTC
I've got this message (film:8280): LibGimp-CRITICAL **: gimp_pixel_rgn_init: assertion `x >= 0 && x + width <= drawable->width' failed /usr/lib/gimp/2.0/plug-ins/film: fatal error: Segmentation fault When tried plugin in this situation: 1. New image (chose size) 2. Draw text on canvas (you'll have a new layer smaller then image, which is, I think, crucial for crash to happen) 3. Start Filmstrip plugin and apply it using default parameters. Message should pop up now.
I can reproduce this, confirming. However it's just the plug-in that crashes, not gimp.
True. Well, sort of... It's true that only plugin crashes, but I can reproduce that crash with any layer smaller then background.
Ok, updating summary.
I don't get a segmentation fault on Windows, but the result isn't correct either; for layers < image size and layers with an offset.
Created attachment 77491 [details] [review] filmstrip fixes Fixes crash when opening layers with offsets and/or smaller than image. Correctly deals with transparent pixels. Coding style improvements.
Thanks for the patch, very welcome. A few hints: you have replaced the scale_image thing with some calls to gimp-internal functions, which seems like a very good idea indeed. When reading a patch it usually is more helpful, when the patch (at first) focusses on the functional aspects, or is in two different patches for the functional bits and the codingstyle bits. I have helped myself by applying the patch and reading the output of cvs diff -w, which helps a lot already since it omits most pure whitespace changes. In Line 545 you work on the pixel region pixel_rgn_dst, which seems uninitialized to me in this part of the if() clause, please look at this again (also, assuming that bpp is 4 resp. 3 is ugly, better query the real bpp first). This probably can be omitted anyway: this copying&pasting of layer content that is done there might be easier to do with gimp_layer_new_from_drawable(), this chould simplify the code drastically. Please review this patch, I'll be glad to apply it if these points get fixed. Thanks a lot for your help!
Ah sorry, I was not careful enough when looking at the pixelregion stuff. It gets initialized. Seems I need to read that stuff again.
Created attachment 77502 [details] [review] filmstrip fixes (changed) Previous patch changed according to recommendations.
Very nice work, thanks a lot! 2006-12-01 Sven Neumann <sven@gimp.org> * plug-ins/common/film.c: applied patch from Aurimas Juška. Fixes crash when opening layers with offsets and/or smaller than image (bug #364429).