Commit 2ec49e6f1 for imagemagick.org
commit 2ec49e6f1971ee5b0ff654364cf806b20c202c86
Author: Cristy <urban-warrior@imagemagick.org>
Date: Wed Sep 9 21:09:22 2026 -0400
https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-q6h4-6f2h-8hfq
diff --git a/MagickCore/attribute.c b/MagickCore/attribute.c
index abbf47508..c4e106174 100644
--- a/MagickCore/attribute.c
+++ b/MagickCore/attribute.c
@@ -550,7 +550,9 @@ MagickExport RectangleInfo GetImageBoundingBox(const Image *image,
}
}
image_view=DestroyCacheView(image_view);
- if ((bounds.width == 0) || (bounds.height == 0))
+ if ((bounds.width == 0) || (bounds.height == 0) ||
+ (bounds.x > (ssize_t) bounds.width) ||
+ (bounds.y > (ssize_t) bounds.height))
(void) ThrowMagickException(exception,GetMagickModule(),OptionWarning,
"GeometryDoesNotContainImage","`%s'",image->filename);
else