Share

giflib -- A library for processing GIFs

Tracker: Bugs

5 giftext seg faults on images with no global colormap - ID: 1544184
Last Update: Comment added ( abadger1999 )

On line 138 of giftext.c, the value of GifFile-
>SColorMap->BitsPerPixel is accessed without first
checking if GifFile->SColorMap in non-NULL.

Image to demonstrate this bug is attached.


Howard Kash ( hmkash ) - 2006-08-21 20:06

5

Closed

None

Nobody/Anonymous

libungif utilitiies

None

Public


Comments ( 3 )




Date: 2007-11-10 04:29
Sender: abadger1999Project AdminAccepting Donations


Going through old tickets. This is now applied on the giflib trunk.


Date: 2007-11-09 15:33
Sender: the_olo


That's great, the linked patch fixes the problem - giftext doesn't
segfault anymore:

(gdb) run ../image001.gif
Starting program: /root/misc/soft/giflib/giflib-4.1.4/util/.libs/giftext
../image001.gif

../image001.gif:

Screen Size - Width = 54, Height = 28.
ColorResolution = 8, BitsPerPixel = 0, BackGround = 1.
No Global Color Map.


GIF89 comment (Ext Code = 254 [ ]):

00000: 53 6f 66 74 77 61 72 65 3a 20 4d 69 63 72 6f 73 Software: Micros

Image #1:

Image Size - Left = 0, Top = 0, Width = 54, Height = 28.
Image is Non Interlaced, BitsPerPixel = 8.
Image Has Color Map.

Gif file terminated normally.

Program exited normally.


Date: 2006-10-16 18:36
Sender: nobody

Logged In: NO

From: http://www.joval.info/proj/FuzzyOcr-
2.3j/patches/giftext-segfault.patch

*** giftext.c.orig 2006-08-21 15:41:47.000000000 -0400
--- giftext.c 2006-08-21 15:41:55.000000000 -0400
***************
*** 135,141 ****
GifFileName, GifFile->SWidth, GifFile-
>SHeight);
printf("\tColorResolution = %d, BitsPerPixel = %d,
BackGround = %d.\n",
GifFile->SColorResolution,
! GifFile->SColorMap->BitsPerPixel,
GifFile->SBackGroundColor);
if (GifFile->SColorMap)
printf("\tHas Global Color Map.\n\n");
--- 135,141 ----
GifFileName, GifFile->SWidth, GifFile-
>SHeight);
printf("\tColorResolution = %d, BitsPerPixel = %d,
BackGround = %d.\n",
GifFile->SColorResolution,
! GifFile->SColorMap?GifFile->SColorMap-
>BitsPerPixel:0,
GifFile->SBackGroundColor);
if (GifFile->SColorMap)
printf("\tHas Global Color Map.\n\n");



Log in to comment.

Attached File ( 1 )

Filename Description Download
image001.gif Image with now global colormap that causes giftext to core dump Download

Changes ( 3 )

Field Old Value Date By
status_id Open 2007-11-10 04:29 abadger1999
close_date - 2007-11-10 04:29 abadger1999
File Added 190030: image001.gif 2006-08-21 20:06 hmkash