When using the undocumented -index suboption of the
-format option to the image create photo command, some
GIF images can cause a segmentation fault. This happens
when the first subimage is smaller than some later
ones. The buffer for storing the image data is
allocated based on the size of the first subimage.
However, that same buffer is used to store all the
subimages that don't all fit.
For some reason I don't get the segmentation fault
unless the requested subimage doesn't exist and the
buffer has to be freed again.
The problem has been observed on SuSE Linux 8.2.
Reproducible script:
package require Tk
image create photo -file segv.gif -format "gif -index 2"
The offending GIF image.
Patch to tkImgGIF.c
Logged In: YES
user_id=79902
Fixed in HEAD (and thanks for the reproducable script!)
Backport to 8.4 still pending...
Logged In: YES
user_id=79902
And also in 8.4 branch.
NB: One new test added - imgPhoto-14.2 - if that passes,
this bug is truly squelched.