Commit 374578b4a for imagemagick.org
commit 374578b4a3562970c12d6beb7e3d815eb6db1170
Author: Cristy <urban-warrior@imagemagick.org>
Date: Sun Jul 5 08:51:24 2026 -0400
sanity check
diff --git a/coders/pgx.c b/coders/pgx.c
index 299a5fa5a..6b2b10f79 100644
--- a/coders/pgx.c
+++ b/coders/pgx.c
@@ -197,6 +197,9 @@ static Image *ReadPGXImage(const ImageInfo *image_info,ExceptionInfo *exception)
(void) CloseBlob(image);
return(GetFirstImageInList(image));
}
+ if ((image->columns > GetBlobSize(image)) ||
+ (image->rows > GetBlobSize(image)))
+ ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
status=SetImageExtent(image,image->columns,image->rows,exception);
if (status == MagickFalse)
return(DestroyImageList(image));