--- readGIF.c.orig 1994-12-09 19:17:03 UTC +++ readGIF.c @@ -253,7 +253,7 @@ GIFStream *GIFReadFP(FILE *fd) cur->data.image.cmapSize = 0; } - cur->data.image.data = (unsigned char *)malloc(cur->width * cur->height); + cur->data.image.data = (unsigned char *)malloc(cur->width * cur->height + 1); cur->data.image.interlaced = BitSet(buf[8], INTERLACE); readImage(fd, BitSet(buf[8], INTERLACE), cur->width, cur->height, cur->data.image.data);