Commit 35cb17198 for imagemagick.org
commit 35cb17198b15ca64dc9f2f9e5ba92e120c01a745
Author: dxbjavid <dxbjavid@gmail.com>
Date: Mon May 25 21:28:12 2026 +0530
reject tga files with zero columns or rows (#8756)
diff --git a/coders/tga.c b/coders/tga.c
index 36406ec1c..24eff3d16 100644
--- a/coders/tga.c
+++ b/coders/tga.c
@@ -344,6 +344,8 @@ static Image *ReadTGAImage(const ImageInfo *image_info,ExceptionInfo *exception)
image->orientation=TopLeftOrientation;
if (image_info->ping != MagickFalse)
{
+ if ((image->columns == 0) || (image->rows == 0))
+ ThrowReaderException(CorruptImageError,"ImproperImageHeader");
(void) CloseBlob(image);
return(image);
}