]> granicus.if.org Git - imagemagick/commitdiff
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7157
authorCristy <urban-warrior@imagemagick.org>
Tue, 27 Mar 2018 22:40:30 +0000 (18:40 -0400)
committerCristy <urban-warrior@imagemagick.org>
Tue, 27 Mar 2018 22:40:47 +0000 (18:40 -0400)
coders/heic.c

index 7e0f7cc0cd89547f8ec22925be0444cf2a40a762..f8f337b9367e50e02c48d95b11382137a4205449 100644 (file)
@@ -686,8 +686,10 @@ static MagickBooleanType ParseAtom(Image *image, DataBuffer *db,
     case ATOM('i', 'd', 'a', 't'):
       {
         ctx->idatSize = atom_size - 8;
+        if (ctx->idat != (uint8_t *) NULL)
+          ctx->idat = (uint8_t *) RelinquishMagickMemory(ctx->idat);
         ctx->idat = (uint8_t *) AcquireMagickMemory(ctx->idatSize);
-        if (ctx->idat == NULL)
+        if (ctx->idat == (uint8_t *) NULL)
           ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
             image->filename);