Skip to content

Commit

Permalink
https://github.com/ImageMagick/ImageMagick/issues/3540
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Apr 14, 2021
1 parent 24030ed commit cd7f9fb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions coders/tiff.c
Expand Up @@ -1245,6 +1245,11 @@ static Image *ReadTIFFImage(const ImageInfo *image_info,
TIFFClose(tiff);
ThrowReaderException(CorruptImageError,"UnsupportedBitsPerPixel");
}
if (samples_per_pixel > MaxPixelChannels)
{
TIFFClose(tiff);
ThrowReaderException(CorruptImageError,"MaximumChannelsExceeded");
}
if (sample_format == SAMPLEFORMAT_IEEEFP)
(void) SetImageProperty(image,"quantum:format","floating-point");
switch (photometric)
Expand Down Expand Up @@ -1617,11 +1622,6 @@ static Image *ReadTIFFImage(const ImageInfo *image_info,
}
if (image->matte != MagickFalse)
(void) SetImageAlphaChannel(image,OpaqueAlphaChannel);
if (samples_per_pixel > MaxPixelChannels)
{
TIFFClose(tiff);
ThrowReaderException(CorruptImageError,"MaximumChannelsExceeded");
}
method=ReadGenericMethod;
rows_per_strip=(uint32) image->rows;
if (TIFFGetField(tiff,TIFFTAG_ROWSPERSTRIP,&rows_per_strip) == 1)
Expand Down

0 comments on commit cd7f9fb

Please sign in to comment.