We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1b5a9c9 + 0c490ac commit 2892557Copy full SHA for 2892557
modules/imgcodecs/src/grfmt_tiff.cpp
@@ -401,6 +401,10 @@ bool TiffDecoder::readData( Mat& img )
401
(!is_tiled && tile_height0 == std::numeric_limits<uint32>::max()) )
402
tile_height0 = m_height;
403
404
+ CV_Assert((int)tile_width0 > 0 && (int)tile_width0 < std::numeric_limits<int>::max());
405
+ CV_Assert((int)tile_height0 > 0 && (int)tile_height0 < std::numeric_limits<int>::max());
406
+ CV_Assert(((uint64_t)tile_width0 * tile_height0 * ncn * (bpp / bitsPerByte) < (CV_BIG_UINT(1) << 30)) && "TIFF tile size is too large: >= 1Gb");
407
+
408
if (dst_bpp == 8)
409
{
410
// we will use TIFFReadRGBA* functions, so allocate temporary buffer for 32bit RGBA
0 commit comments