fix bug with invalid signature size (should not be less than signatureLength())

pull/2914/head
Alexander Alekhin 11 years ago
parent 3a8af7d691
commit 5c8cd76893
  1. 2
      modules/highgui/src/loadsave.cpp

@ -137,9 +137,9 @@ static ImageDecoder findDecoder( const Mat& buf )
maxlen = std::max(maxlen, len);
}
string signature(maxlen, ' ');
size_t bufSize = buf.rows*buf.cols*buf.elemSize();
maxlen = std::min(maxlen, bufSize);
string signature(maxlen, ' ');
memcpy( &signature[0], buf.data, maxlen );
for( i = 0; i < codecs.decoders.size(); i++ )

Loading…
Cancel
Save