Commit f028fe940 for imagemagick.org
commit f028fe940b90aa3d3cd78b4199e2a05bf9e0190d
Author: Dirk Lemstra <dirk@lemstra.org>
Date: Sat May 2 17:16:28 2026 +0200
Another fix to check for the 32-bit overflow.
diff --git a/coders/sfw.c b/coders/sfw.c
index cca66ab05..083fb84a1 100644
--- a/coders/sfw.c
+++ b/coders/sfw.c
@@ -251,7 +251,7 @@ static Image *ReadSFWImage(const ImageInfo *image_info,ExceptionInfo *exception)
Read image into a buffer.
*/
extent=(size_t) GetBlobSize(image)+MagickPathExtent;
- if (GetBlobSize(image) != extent)
+ if (extent < GetBlobSize(image))
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
if (GetBlobSize(image) < 141)
ThrowReaderException(CorruptImageError,"ImproperImageHeader");