Skip to content

Commit

Permalink
Merge pull request opencv#14268 from alalek:fix_ossfuzz_13283
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Apr 5, 2019
2 parents 1b5a9c9 + 0c490ac commit 2892557
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/imgcodecs/src/grfmt_tiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2892557

Please sign in to comment.