mirror of
https://github.com/opencv/opencv.git
synced 2024-11-28 13:10:12 +08:00
Merge pull request #14268 from alalek:fix_ossfuzz_13283
This commit is contained in:
commit
28925572f6
@ -401,6 +401,10 @@ bool TiffDecoder::readData( Mat& img )
|
||||
(!is_tiled && tile_height0 == std::numeric_limits<uint32>::max()) )
|
||||
tile_height0 = m_height;
|
||||
|
||||
CV_Assert((int)tile_width0 > 0 && (int)tile_width0 < std::numeric_limits<int>::max());
|
||||
CV_Assert((int)tile_height0 > 0 && (int)tile_height0 < std::numeric_limits<int>::max());
|
||||
CV_Assert(((uint64_t)tile_width0 * tile_height0 * ncn * (bpp / bitsPerByte) < (CV_BIG_UINT(1) << 30)) && "TIFF tile size is too large: >= 1Gb");
|
||||
|
||||
if (dst_bpp == 8)
|
||||
{
|
||||
// we will use TIFFReadRGBA* functions, so allocate temporary buffer for 32bit RGBA
|
||||
|
Loading…
Reference in New Issue
Block a user