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 74fb410 commit c6ad94f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions coders/tiff.c
Expand Up @@ -1360,6 +1360,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",
exception);
Expand Down Expand Up @@ -1728,11 +1733,6 @@ static Image *ReadTIFFImage(const ImageInfo *image_info,
}
if (image->alpha_trait != UndefinedPixelTrait)
(void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
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 c6ad94f

Please sign in to comment.