Menu

#2043 Segmentation fault when using animated GIFs

obsolete: 8.4.12
closed-fixed
9
2006-03-27
2006-03-25
No

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"

Discussion

  • Schelte Bron

    Schelte Bron - 2006-03-25

    The offending GIF image.

     
  • Schelte Bron

    Schelte Bron - 2006-03-25

    Patch to tkImgGIF.c

     
  • Don Porter

    Don Porter - 2006-03-25
    • priority: 5 --> 9
    • assigned_to: nobody --> dkf
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    Fixed in HEAD (and thanks for the reproducable script!)

    Backport to 8.4 still pending...

     
  • Donal K. Fellows

    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.

     
  • Donal K. Fellows

    • status: open --> closed-fixed