Commit 9d1764c43 for imagemagick.org
commit 9d1764c43a15b78e18a7f66649989d59079a9e15
Author: Cristy <urban-warrior@imagemagick.org>
Date: Sun Jun 7 22:05:34 2026 -0400
https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-8g53-9m3c-69xg#advisory-comment-224693
diff --git a/coders/png.c b/coders/png.c
index 12a1df349..3dbec1744 100644
--- a/coders/png.c
+++ b/coders/png.c
@@ -6605,7 +6605,7 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,
}
n=GetAuthenticPixels(image,0,0,image->columns,1,exception);
- (void) memcpy(next,n,length);
+ (void) memcpy(next,n,length*sizeof(*next));
for (y=0; y < (ssize_t) image->rows; y++)
{
@@ -6631,8 +6631,8 @@ static Image *ReadOneMNGImage(MngReadInfo* mng_info,
if (y < (ssize_t) image->rows-1)
{
n=GetAuthenticPixels(image,0,y+1,image->columns,1,
- exception);
- (void) memcpy(next,n,length);
+ exception);
+ (void) memcpy(next,n,length*sizeof(*next));
}
for (i=0; i < m; i++, yy++)