]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Fri, 24 Nov 2017 19:54:30 +0000 (14:54 -0500)
committerCristy <urban-warrior@imagemagick.org>
Fri, 24 Nov 2017 19:54:30 +0000 (14:54 -0500)
coders/jpeg.c

index 12d10d65b389e61bc2f791b13ede8f5191a1ac36..ec1aa2d8a3ff53b86fd34e6a8810bc04aa29f381 100644 (file)
@@ -2309,7 +2309,9 @@ static MagickBooleanType WriteJPEGImage(const ImageInfo *image_info,
           /*
             Perform optimization only if available memory resources permit it.
           */
-          status=AcquireMagickResource(AreaResource,length);
+          status=AcquireMagickResource(MemoryResource,length);
+          if (status != MagickFalse)
+            RelinquishMagickResource(MemoryResource,length);
           jpeg_info.optimize_coding=status == MagickFalse ? FALSE : TRUE;
         }
     }