From c06b745f228d26710d35b0121745f13d4c3a54b4 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sat, 14 Apr 2018 13:43:24 +0200 Subject: [PATCH] Fixed refactor mistake. --- coders/miff.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/coders/miff.c b/coders/miff.c index 5d7a4f0df..f7f7c5f84 100644 --- a/coders/miff.c +++ b/coders/miff.c @@ -2421,15 +2421,18 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info, } if (image->storage_class == PseudoClass) { + size_t + colormap_size; + unsigned char *colormap; /* Allocate colormap. */ - packet_size=(size_t) (3*quantum_info->depth/8); + colormap_size=(size_t) (3*quantum_info->depth/8); colormap=(unsigned char *) AcquireQuantumMemory(image->colors, - packet_size*sizeof(*colormap)); + colormap_size*sizeof(*colormap)); if (colormap == (unsigned char *) NULL) ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); /* @@ -2492,7 +2495,7 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info, } } } - (void) WriteBlob(image,packet_size*image->colors,colormap); + (void) WriteBlob(image,colormap_size*image->colors,colormap); colormap=(unsigned char *) RelinquishMagickMemory(colormap); } /* -- 2.40.0