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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user