From 771e54d106ce5ff043e7812b4182f3c08a748001 Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 16 Mar 2018 18:56:37 -0400 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6915 --- coders/pdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coders/pdb.c b/coders/pdb.c index 0e99876d3..52ba27997 100644 --- a/coders/pdb.c +++ b/coders/pdb.c @@ -424,7 +424,7 @@ static Image *ReadPDBImage(const ImageInfo *image_info,ExceptionInfo *exception) if (pixels == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); (void) memset(pixels,0,(packets+257UL)*image->rows*sizeof(*pixels)); - switch (pdb_image.version & 0x07) + switch (pdb_image.version & 0x07) { case 0: { @@ -860,6 +860,7 @@ static MagickBooleanType WritePDBImage(const ImageInfo *image_info,Image *image, scanline=(unsigned char *) RelinquishMagickMemory(scanline); ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); } + (void) ResetMagickMemory(buffer,0,512*sizeof(*buffer)); if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse) (void) TransformImageColorspace(image,sRGBColorspace,exception); /* -- 2.40.0