diff options
Diffstat (limited to 'coders/mac.c')
-rw-r--r-- | coders/mac.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/coders/mac.c b/coders/mac.c index a159bb1dd..3071c98cf 100644 --- a/coders/mac.c +++ b/coders/mac.c @@ -18,7 +18,7 @@ % July 1992 % % % % % -% Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization % +% Copyright 1999-2021 ImageMagick Studio LLC, a non-profit organization % % dedicated to making software imaging solutions freely available. % % % % You may not use this file except in compliance with the License. You may % @@ -95,13 +95,13 @@ static Image *ReadMACImage(const ImageInfo *image_info,ExceptionInfo *exception) MagickBooleanType status; - register Quantum + Quantum *q; - register ssize_t + ssize_t x; - register unsigned char + unsigned char *p; size_t @@ -163,9 +163,10 @@ static Image *ReadMACImage(const ImageInfo *image_info,ExceptionInfo *exception) Convert MAC raster image to pixel packets. */ length=(image->columns+7)/8; - pixels=(unsigned char *) AcquireQuantumMemory(length+1,sizeof(*pixels)); + pixels=(unsigned char *) AcquireQuantumMemory(length+257,sizeof(*pixels)); if (pixels == (unsigned char *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); + (void) memset(pixels,0,(length+257)*sizeof(*pixels)); p=pixels; offset=0; for (y=0; y < (ssize_t) image->rows; ) |