From: Cristy Date: Thu, 16 May 2019 11:12:54 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.8-46~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=857bbadbf0aaf10f704eea11bd894a0aecd18992;p=imagemagick ... --- diff --git a/MagickCore/geometry.c b/MagickCore/geometry.c index d67b1b503..ff38f17dd 100644 --- a/MagickCore/geometry.c +++ b/MagickCore/geometry.c @@ -366,13 +366,13 @@ MagickExport char *GetPageGeometry(const char *page_geometry) typedef struct _PageInfo { const char - *name; + name[11]; size_t extent; const char - *geometry; + geometry[10]; } PageInfo; static const PageInfo diff --git a/MagickCore/type.c b/MagickCore/type.c index 2f78bbb0c..e4b0fbcf2 100644 --- a/MagickCore/type.c +++ b/MagickCore/type.c @@ -109,7 +109,7 @@ Declare type map. */ static const char - *TypeMap = (const char *) + TypeMap[] = "" "" " " @@ -327,8 +327,8 @@ MagickExport const TypeInfo *GetTypeInfoByFamily(const char *family, typedef struct _Fontmap { const char - *name, - *substitute; + name[17], + substitute[10]; } Fontmap; const TypeInfo @@ -352,8 +352,7 @@ MagickExport const TypeInfo *GetTypeInfoByFamily(const char *family, { "news gothic", "helvetica" }, { "system", "courier" }, { "terminal", "courier" }, - { "wingdings", "symbol" }, - { NULL, NULL } + { "wingdings", "symbol" } }; size_t @@ -475,7 +474,7 @@ MagickExport const TypeInfo *GetTypeInfoByFamily(const char *family, /* Check for table-based substitution match. */ - for (i=0; fontmap[i].name != (char *) NULL; i++) + for (i=0; i < (sizeof(fontmap)/sizeof(fontmap[0])); i++) { if (family == (const char *) NULL) { diff --git a/coders/pdf.c b/coders/pdf.c index 249d2cff9..721b93edd 100644 --- a/coders/pdf.c +++ b/coders/pdf.c @@ -2965,8 +2965,12 @@ RestoreMSCWarning (void) WriteBlobString(image,buffer); (void) WriteBlobString(image,"<<\n"); if (LocaleCompare(image_info->magick,"PDFA") == 0) - (void) FormatLocaleString(buffer,MagickPathExtent,"/Title (%s)\n", - EscapeParenthesis(basename)); + { + escape=EscapeParenthesis(basename); + (void) FormatLocaleString(buffer,MagickPathExtent,"/Title (%s)\n", + escape); + escape=DestroyString(escape); + } else { wchar_t diff --git a/coders/pict.c b/coders/pict.c index 0ce8ad8c9..b8f7c6c78 100644 --- a/coders/pict.c +++ b/coders/pict.c @@ -325,8 +325,9 @@ static MagickBooleanType % */ -static const unsigned char *ExpandBuffer(const unsigned char *magick_restrict pixels, - const unsigned int bits_per_pixel,MagickSizeType *bytes_per_line) +static const unsigned char *UnpackScanline( + const unsigned char *magick_restrict pixels,const unsigned int bits_per_pixel, + unsigned char *scanline,MagickSizeType *bytes_per_line) { register const unsigned char *p; @@ -337,9 +338,6 @@ static const unsigned char *ExpandBuffer(const unsigned char *magick_restrict pi register unsigned char *q; - static unsigned char - scanline[8*256]; - p=pixels; q=scanline; switch (bits_per_pixel) @@ -427,7 +425,8 @@ static unsigned char *DecodeImage(Image *blob,Image *image, unsigned char *pixels, - *scanline; + *scanline, + unpack_buffer[8*256]; /* Determine pixel buffer size. @@ -482,7 +481,7 @@ static unsigned char *DecodeImage(Image *blob,Image *image, status=MagickFalse; break; } - p=ExpandBuffer(scanline,bits_per_pixel,&number_pixels); + p=UnpackScanline(scanline,bits_per_pixel,unpack_buffer,&number_pixels); if ((q+number_pixels) > (pixels+(*extent))) { status=MagickFalse; @@ -521,7 +520,8 @@ static unsigned char *DecodeImage(Image *blob,Image *image, { length=(size_t) ((scanline[j] & 0xff)+1); number_pixels=length*bytes_per_pixel; - p=ExpandBuffer(scanline+j+1,bits_per_pixel,&number_pixels); + p=UnpackScanline(scanline+j+1,bits_per_pixel,unpack_buffer, + &number_pixels); if ((q-pixels+number_pixels) <= *extent) (void) memcpy(q,p,(size_t) number_pixels); q+=number_pixels; @@ -531,7 +531,8 @@ static unsigned char *DecodeImage(Image *blob,Image *image, { length=(size_t) (((scanline[j] ^ 0xff) & 0xff)+2); number_pixels=bytes_per_pixel; - p=ExpandBuffer(scanline+j+1,bits_per_pixel,&number_pixels); + p=UnpackScanline(scanline+j+1,bits_per_pixel,unpack_buffer, + &number_pixels); for (i=0; i < (ssize_t) length; i++) { if ((q-pixels+number_pixels) <= *extent)