From 7358503346d1966c780ae947610102d8fe9dbe53 Mon Sep 17 00:00:00 2001 From: Cristy Date: Wed, 7 Feb 2018 16:04:57 -0500 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6068 --- coders/miff.c | 3 +++ coders/mpc.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/coders/miff.c b/coders/miff.c index d42d5340c..f79216ab9 100644 --- a/coders/miff.c +++ b/coders/miff.c @@ -913,6 +913,9 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, length=(size_t) StringToLong(options); if ((MagickSizeType) length > GetBlobSize(image)) { + if (profiles != (LinkedListInfo *) NULL) + profiles=DestroyLinkedList(profiles, + RelinquishMagickMemory); options=DestroyString(options); ThrowReaderException(CorruptImageError, "InsufficientImageDataInFile"); diff --git a/coders/mpc.c b/coders/mpc.c index 35f75ea68..fe6506bec 100644 --- a/coders/mpc.c +++ b/coders/mpc.c @@ -634,6 +634,9 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) length=StringToLong(options); if ((MagickSizeType) length > GetBlobSize(image)) { + if (profiles != (LinkedListInfo *) NULL) + profiles=DestroyLinkedList(profiles, + RelinquishMagickMemory); options=DestroyString(options); ThrowReaderException(CorruptImageError, "InsufficientImageDataInFile"); -- 2.40.0