Skip to content

Commit

Permalink
Eliminate out-of-memory in TGA format
Browse files Browse the repository at this point in the history
Credit OSS Fuzz
  • Loading branch information
Cristy committed Jan 23, 2018
1 parent 0897510 commit ac928f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
2018-01-23 7.0.7-23 Cristy <quetzlzacatenango@image...>
* 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 <quetzlzacatenango@image...>
* Release ImageMagick version 7.0.0-22, GIT revision 22391:e8be814f1:20180122.
Expand Down
2 changes: 1 addition & 1 deletion coders/tga.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit ac928f2

Please sign in to comment.