From: Cristy Date: Sat, 13 Oct 2018 15:09:28 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/1345 X-Git-Tag: 7.0.8-13~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=43f70257c4064b93ed8be1f20e4bd7c33e14a84a;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/1345 --- diff --git a/coders/pdb.c b/coders/pdb.c index e7fe2c7f1..2695ea049 100644 --- a/coders/pdb.c +++ b/coders/pdb.c @@ -884,7 +884,12 @@ static MagickBooleanType WritePDBImage(const ImageInfo *image_info,Image *image, quantum_info=AcquireQuantumInfo(image_info,image); if (quantum_info == (QuantumInfo *) NULL) { - runlength=(unsigned char *) RelinquishMagickMemory(runlength); + if (runlength != (unsigned char *) NULL) + runlength=(unsigned char *) RelinquishMagickMemory(runlength); + if (buffer != (unsigned char *) NULL) + buffer=(unsigned char *) RelinquishMagickMemory(buffer); + if (scanline != (unsigned char *) NULL) + scanline=(unsigned char *) RelinquishMagickMemory(scanline); ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); } status=SetQuantumDepth(image,quantum_info,image->depth > 8 ? 16 : 8);