]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <mikayla-grace@urban-warrior.org>
Thu, 16 May 2019 11:12:54 +0000 (07:12 -0400)
committerCristy <mikayla-grace@urban-warrior.org>
Thu, 16 May 2019 11:12:54 +0000 (07:12 -0400)
MagickCore/geometry.c
MagickCore/type.c
coders/pdf.c
coders/pict.c

index d67b1b5031ae9882292bb00b6fd648a1062cbb87..ff38f17dd4a619ccadc6be0ecba9d4baae327355 100644 (file)
@@ -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
index 2f78bbb0ce7b8d28b3fee3c87b820f75a8a8ed18..e4b0fbcf206698caea1684188e7c694cb55562b3 100644 (file)
   Declare type map.
 */
 static const char
-  *TypeMap = (const char *)
+  TypeMap[] =
     "<?xml version=\"1.0\"?>"
     "<typemap>"
     "  <type stealth=\"True\" name=\"fixed\" family=\"helvetica\"/>"
@@ -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)
       {
index 249d2cff992e4ce674625618c716129bd35e3b35..721b93edd65081be7f4bcc39289b2b489c85e870 100644 (file)
@@ -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
index 0ce8ad8c97b4cab799af49f740eea8e5a03bb71f..b8f7c6c787292046ddce2d449f7e6fb8b811484d 100644 (file)
@@ -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)