From 1ffd2364cb7e4d9f54155c5d6266f102ddaf5ed1 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Mon, 10 Jul 2017 09:26:08 -0400 Subject: [PATCH] Undo temporary overallocation in the MNG decoder --- coders/png.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/coders/png.c b/coders/png.c index 04730f47d..60e072f79 100644 --- a/coders/png.c +++ b/coders/png.c @@ -4392,8 +4392,7 @@ static Image *ReadOneJNGImage(MngInfo *mng_info, { if (length > GetBlobSize(image)) ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); - chunk=(unsigned char *) AcquireQuantumMemory(length+MagickPathExtent, - sizeof(*chunk)); + chunk=(unsigned char *) AcquireQuantumMemory(length,sizeof(*chunk)); if (chunk == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); @@ -5271,8 +5270,7 @@ static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, if (length > GetBlobSize(image)) ThrowReaderException(CorruptImageError, "InsufficientImageDataInFile"); - chunk=(unsigned char *) AcquireQuantumMemory(length+ - MagickPathExtent,sizeof(*chunk)); + chunk=(unsigned char *) AcquireQuantumMemory(length,sizeof(*chunk)); if (chunk == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); -- 2.50.1