]> granicus.if.org Git - imagemagick/commitdiff
Fixed memory leak reported in #456.
authorDirk Lemstra <dirk@git.imagemagick.org>
Tue, 2 May 2017 06:32:29 +0000 (08:32 +0200)
committerDirk Lemstra <dirk@git.imagemagick.org>
Tue, 2 May 2017 06:32:29 +0000 (08:32 +0200)
coders/art.c

index b54cde4920e5af9e08712a57bbcc0e5bfcbf8460..f96083245b23a9e0abb325b4267f65f7a0c5825e 100644 (file)
@@ -168,7 +168,10 @@ static Image *ReadARTImage(const ImageInfo *image_info,ExceptionInfo *exception)
     pixels=(const unsigned char *) ReadBlobStream(image,length,
       GetQuantumPixels(quantum_info),&count);
     if (count != (ssize_t) length)
-      ThrowReaderException(CorruptImageError,"UnableToReadImageData");
+      {
+        quantum_info=DestroyQuantumInfo(quantum_info);
+        ThrowReaderException(CorruptImageError,"UnableToReadImageData");
+      }
     (void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
       GrayQuantum,pixels,exception);
     pixels=(const unsigned char *) ReadBlobStream(image,(size_t) (-(ssize_t)