1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

imgcodecs: add runtime checks to validate input

This commit is contained in:
Alexander Alekhin
2022-02-15 11:48:09 +00:00
parent 19926e2979
commit f9b1dbe2ac
3 changed files with 11 additions and 3 deletions
+2 -2
View File
@@ -149,8 +149,8 @@ bool TiffDecoder::checkSignature( const String& signature ) const
int TiffDecoder::normalizeChannelsNumber(int channels) const
{
CV_Assert(channels <= 4);
return channels > 4 ? 4 : channels;
CV_Check(channels, channels >= 1 && channels <= 4, "Unsupported number of channels");
return channels;
}
ImageDecoder TiffDecoder::newDecoder() const