[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#384773: libungif-bin: giftext segfault on image with no global colour map



Package: libungif-bin
Severity: normal
Tags: patch

GIFs don't have to have a global colour map, it can be absent and supplied
in a per-image colour map.  This causes utils/giftext to segfault.
Christian Holler aka decoder_at_own-hero_dot_net discovered this problem
in GIFs comprising part of image-only spam.  giftext is used in his
spamassassin plugin to decode and catch this type of spam.

I'm forwarding his patch so that it can be included in Debian and Debian
users can have the benefit of it.  Thanks and acknowledgements are due
to him.

Nick Leverton

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (800, 'testing'), (60, 'stable'), (3, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-16bpo1.20060720.0-k7-njl
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
*** 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");

Reply to: