Merge pull request #14200 from alalek:fix_imgcodecs_stream_set_pos

This commit is contained in:
Alexander Alekhin 2019-04-01 11:04:20 +00:00
commit bda90dae77

View File

@ -175,8 +175,11 @@ void RBaseStream::setPos( int pos )
}
int offset = pos % m_block_size;
int old_block_pos = m_block_pos;
m_block_pos = pos - offset;
m_current = m_start + offset;
if (old_block_pos != m_block_pos)
readBlock();
}