Menu

#3 EGifOpen doesn't initialize the compression hash table

closed
nobody
None
5
2012-10-16
2004-12-07
Tony Cook
No

Unlike the other EGifOpen...() functions, EGifOpen()
doesn't initialize the compression hash table. This
patch fixes that.

This only applies to giflib, not to libungif.

diff -ru giflib-4.1.3/lib/egif_lib.c
giflib-4.1.3-works/lib/egif_lib.c
--- giflib-4.1.3/lib/egif_lib.c Sun May 30 08:48:48 2004
+++ giflib-4.1.3-works/lib/egif_lib.c Wed Dec 8
00:02:00 2004
@@ -188,6 +188,12 @@
_GifError = E_GIF_ERR_NOT_ENOUGH_MEM;
return NULL;
}
+ if ((Private->HashTable = _InitHashTable()) == NULL) {
+ free(GifFile);
+ free(Private);
+ _GifError = E_GIF_ERR_NOT_ENOUGH_MEM;
+ return NULL;
+ }

 GifFile->Private = (VoidPtr) Private;
 Private->FileHandle = 0;

Discussion

  • Tony Cook

    Tony Cook - 2004-12-07

    patch attached to avoid any mangling

     
  • Tony Cook

    Tony Cook - 2004-12-07

    Logged In: YES
    user_id=538565

    never mind, someone else had already supplied a similar
    patch (any chance of a release so I can point people at a
    version that works?)

     

Log in to post a comment.