Commit 81ac6d629 for imagemagick.org
commit 81ac6d62925090f274278d95a7acf11be749838c
Author: Naveed Khan <164054284+rootvector2@users.noreply.github.com>
Date: Tue Nov 3 22:15:28 2026 +0530
reject negative thumbnail length in WriteTHUMBNAILImage (#9087)
diff --git a/coders/thumbnail.c b/coders/thumbnail.c
index a5cd6783b..c53184cb2 100644
--- a/coders/thumbnail.c
+++ b/coders/thumbnail.c
@@ -206,7 +206,7 @@ static MagickBooleanType WriteTHUMBNAILImage(const ImageInfo *image_info,
q++;
}
if ((q > (GetStringInfoDatum(profile)+GetStringInfoLength(profile))) ||
- ((ssize_t) length > (GetStringInfoDatum(profile)+GetStringInfoLength(profile)-q)))
+ (length > (size_t) (GetStringInfoDatum(profile)+GetStringInfoLength(profile)-q)))
ThrowWriterException(CoderError,"ImageDoesNotHaveAThumbnail");
write_info=CloneImageInfo(image_info);
*write_info->magick='\0';