Fixed several issues found by static analysis
This commit is contained in:
@@ -76,6 +76,7 @@ RBaseStream::RBaseStream()
|
||||
{
|
||||
m_start = m_end = m_current = 0;
|
||||
m_file = 0;
|
||||
m_block_pos = 0;
|
||||
m_block_size = BS_DEF_BLOCK_SIZE;
|
||||
m_is_opened = false;
|
||||
m_allocated = false;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -364,7 +364,7 @@ int my_jpeg_load_dht (struct jpeg_decompress_struct *info, unsigned char *dht,
|
||||
|
||||
if (index & 0x10)
|
||||
{
|
||||
index -= 0x10;
|
||||
index &= ~0x10;
|
||||
hufftbl = &ac_tables[index];
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user