]> granicus.if.org Git - imagemagick/commitdiff
Added ResetMagickMemory to fix reading from initialized memory.
authorDirk Lemstra <dirk@git.imagemagick.org>
Sun, 14 Jan 2018 00:20:15 +0000 (01:20 +0100)
committerDirk Lemstra <dirk@git.imagemagick.org>
Sun, 14 Jan 2018 00:20:15 +0000 (01:20 +0100)
Credit to OSS-Fuzz

coders/gif.c

index 0ee58a1b4982f06c4a7223e5b7108161a0e7933d..a778a142d579a02997af11b810faa2eae4c422e9 100644 (file)
@@ -227,6 +227,10 @@ static LZWInfo *AcquireLZWInfo(Image *image,const size_t data_size)
       lzw_info=RelinquishLZWInfo(lzw_info);
       return((LZWInfo *) NULL);
     }
+  (void) ResetMagickMemory(lzw_info->table[0],0,MaximumLZWCode*
+    sizeof(**lzw_info->table));
+  (void) ResetMagickMemory(lzw_info->table[1],0,MaximumLZWCode*
+    sizeof(**lzw_info->table));
   for (i=0; i <= (ssize_t) lzw_info->maximum_data_value; i++)
   {
     lzw_info->table[0][i]=0;