mirror of
https://github.com/opencv/opencv.git
synced 2024-11-28 05:06:29 +08:00
imgproc(hdr): fix bounds check in HdrDecoder::checkSignature()
This commit is contained in:
parent
30373d2566
commit
4ca89db22d
@ -101,10 +101,14 @@ bool HdrDecoder::readData(Mat& _img)
|
|||||||
|
|
||||||
bool HdrDecoder::checkSignature( const String& signature ) const
|
bool HdrDecoder::checkSignature( const String& signature ) const
|
||||||
{
|
{
|
||||||
if(signature.size() >= m_signature.size() &&
|
if (signature.size() >= m_signature.size() &&
|
||||||
(!memcmp(signature.c_str(), m_signature.c_str(), m_signature.size()) ||
|
0 == memcmp(signature.c_str(), m_signature.c_str(), m_signature.size())
|
||||||
!memcmp(signature.c_str(), m_signature_alt.c_str(), m_signature_alt.size())))
|
)
|
||||||
return true;
|
return true;
|
||||||
|
if (signature.size() >= m_signature_alt.size() &&
|
||||||
|
0 == memcmp(signature.c_str(), m_signature_alt.c_str(), m_signature_alt.size())
|
||||||
|
)
|
||||||
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user