]> granicus.if.org Git - imagemagick/commitdiff
Fixed memory leak (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5601)
authorDirk Lemstra <dirk@git.imagemagick.org>
Sun, 4 Mar 2018 10:57:54 +0000 (11:57 +0100)
committerDirk Lemstra <dirk@git.imagemagick.org>
Sun, 4 Mar 2018 10:57:54 +0000 (11:57 +0100)
coders/rle.c

index 9b2439b8622bbd75df00bcbdbef1707eb616580d..9e875dd8ea927f600247ba7ce70eaa0c9b69bb9a 100644 (file)
@@ -329,7 +329,13 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception)
         break;
     status=SetImageExtent(image,image->columns,image->rows,exception);
     if (status == MagickFalse)
-      return(DestroyImageList(image));
+      {
+        if (colormap != (unsigned char *) NULL)
+          colormap=(unsigned char *) RelinquishMagickMemory(colormap);
+        if (pixel_info != (MemoryInfo *) NULL)
+          pixel_info=RelinquishVirtualMemory(pixel_info);
+        return(DestroyImageList(image));
+      }
     /*
       Allocate RLE pixels.
     */