From: Cristy Date: Tue, 23 Jan 2018 14:21:05 +0000 (-0500) Subject: Eliminate out-of-memory in TGA format X-Git-Tag: 7.0.7-23~298 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac928f2ba4d6ef9cc148eb8c324d6f714658175d;p=imagemagick Eliminate out-of-memory in TGA format Credit OSS Fuzz --- diff --git a/ChangeLog b/ChangeLog index f6914602c..7957046b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,5 @@ 2018-01-23 7.0.7-23 Cristy - * Fixed numerous memory leaks, credit to OSS Fuzz. + * Fixed numerous use of uninitialized value, credit to OSS Fuzz. 2018-01-22 7.0.7-22 Cristy * Release ImageMagick version 7.0.0-22, GIT revision 22391:e8be814f1:20180122. diff --git a/coders/tga.c b/coders/tga.c index 325f4205b..259677c91 100644 --- a/coders/tga.c +++ b/coders/tga.c @@ -271,7 +271,7 @@ static Image *ReadTGAImage(const ImageInfo *image_info, one=1; image->colors=one << tga_info.bits_per_pixel; - if (image->colors > ((~0UL)/sizeof(*image->colormap))) + if (image->colors > ((~0U)/sizeof(*image->colormap))) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); if (AcquireImageColormap(image,image->colors,exception) == MagickFalse) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");