Fixed several issues found by static analysis
This commit is contained in:
@@ -208,9 +208,12 @@ bool ExrDecoder::readData( Mat& img )
|
||||
|
||||
xstep = m_native_depth ? 4 : 1;
|
||||
|
||||
AutoBuffer<char> copy_buffer;
|
||||
|
||||
if( !m_native_depth || (!color && m_iscolor ))
|
||||
{
|
||||
buffer = (char *)new float[ m_width * 3 ];
|
||||
copy_buffer.allocate(sizeof(float) * m_width * 3);
|
||||
buffer = copy_buffer;
|
||||
ystep = 0;
|
||||
}
|
||||
else
|
||||
@@ -388,11 +391,6 @@ bool ExrDecoder::readData( Mat& img )
|
||||
|
||||
close();
|
||||
|
||||
if( !m_native_depth || (!color && m_iscolor ))
|
||||
{
|
||||
delete[] buffer;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user