]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Sun, 24 Feb 2019 18:44:01 +0000 (13:44 -0500)
committerCristy <urban-warrior@imagemagick.org>
Sun, 24 Feb 2019 18:44:14 +0000 (13:44 -0500)
coders/wpg.c

index 756c41c265005be6cd304ba2a1af1069c72ecd5a..6994ca0c505b42ed8816d92400d88dd30ec00b5f 100644 (file)
@@ -1262,8 +1262,8 @@ static Image *ReadWPGImage(const ImageInfo *image_info,
                             RelinquishMagickMemory(colormap);
                           goto NoMemory;
                         }
-                      (void) memcpy(image->colormap,colormap,colors*
-                        sizeof(*image->colormap));
+                      (void) memcpy(image->colormap,colormap,MagickMin(
+                        image->colors,colors)*sizeof(*image->colormap));
                       colormap=(PixelInfo *)
                         RelinquishMagickMemory(colormap);
                     }