]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Thu, 6 Dec 2018 01:06:31 +0000 (20:06 -0500)
committerCristy <urban-warrior@imagemagick.org>
Thu, 6 Dec 2018 01:06:31 +0000 (20:06 -0500)
coders/xpm.c

index df8229bb842d7dce1e73010213fa139843bf2226..232ff2df274f9358bb3a11db315ca5dcca0ed618 100644 (file)
@@ -145,7 +145,7 @@ static int CompareXPMColor(const void *target,const void *source)
   const char
     *p,
     *q;
+
   p=(const char *) target;
   q=(const char *) source;
   return(strcmp(p,q));
@@ -756,7 +756,10 @@ static MagickBooleanType WritePICONImage(const ImageInfo *image_info,
         picon->colormap,(size_t) colors,sizeof(*picon->colormap));
       if (picon->colormap == (PixelInfo *) NULL)
         ThrowWriterException(ResourceLimitError,"MemoryAllocationError");
-      SetPixelIndex(picon,(Quantum) picon->colors,0);
+      picon->colormap[colors-1].red=0;
+      picon->colormap[colors-1].green=0;
+      picon->colormap[colors-1].blue=0;
+      picon->colormap[colors-1].alpha=TransparentAlpha;
       for (y=0; y < (ssize_t) picon->rows; y++)
       {
         q=GetAuthenticPixels(picon,0,y,picon->columns,1,exception);