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