]> granicus.if.org Git - imagemagick/blobdiff - coders/mpc.c
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31438
[imagemagick] / coders / mpc.c
index e3e8641c368f9e470ecaf764d50d09b87a8b3a07..6fd18486bbb17a1030713c8b72362355d403140d 100644 (file)
@@ -339,12 +339,6 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception)
               case 'a':
               case 'A':
               {
-                if (LocaleCompare(keyword,"alpha-color") == 0)
-                  {
-                    (void) QueryColorCompliance(options,AllCompliance,
-                      &image->alpha_color,exception);
-                    break;
-                  }
                 if (LocaleCompare(keyword,"alpha-trait") == 0)
                   {
                     ssize_t
@@ -537,6 +531,12 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception)
                     signature=(unsigned int) StringToUnsignedLong(options);
                     break;
                   }
+                if (LocaleCompare(keyword,"mattecolor") == 0)
+                  {
+                    (void) QueryColorCompliance(options,AllCompliance,
+                      &image->matte_color,exception);
+                    break;
+                  }
                 if (LocaleCompare(keyword,"maximum-error") == 0)
                   {
                     image->error.normalized_maximum_error=StringToDouble(
@@ -850,9 +850,7 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception)
         /*
           Create image colormap.
         */
-        image->colormap=(PixelInfo *) AcquireQuantumMemory(image->colors+1,
-          sizeof(*image->colormap));
-        if (image->colormap == (PixelInfo *) NULL)
+        if (AcquireImageColormap(image,image->colors) == MagickFalse)
           ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
         if (image->colors != 0)
           {