fix bug with invalid signature size (should not be less than signatureLength())
This commit is contained in:
parent
3a8af7d691
commit
5c8cd76893
@ -137,9 +137,9 @@ static ImageDecoder findDecoder( const Mat& buf )
|
|||||||
maxlen = std::max(maxlen, len);
|
maxlen = std::max(maxlen, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string signature(maxlen, ' ');
|
||||||
size_t bufSize = buf.rows*buf.cols*buf.elemSize();
|
size_t bufSize = buf.rows*buf.cols*buf.elemSize();
|
||||||
maxlen = std::min(maxlen, bufSize);
|
maxlen = std::min(maxlen, bufSize);
|
||||||
string signature(maxlen, ' ');
|
|
||||||
memcpy( &signature[0], buf.data, maxlen );
|
memcpy( &signature[0], buf.data, maxlen );
|
||||||
|
|
||||||
for( i = 0; i < codecs.decoders.size(); i++ )
|
for( i = 0; i < codecs.decoders.size(); i++ )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user