1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

imgcodecs: add runtime checks to validate input

backport of commit: f9b1dbe2ac
This commit is contained in:
Alexander Alekhin
2022-02-15 11:48:09 +00:00
parent 1620a1e014
commit 2b7803dbac
2 changed files with 10 additions and 2 deletions
+2 -2
View File
@@ -145,8 +145,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