Commit 6dfb6a30 authored by Alexander Alekhin's avatar Alexander Alekhin

imgcodecs: fix RBaseStream::setPos() outside of current block

Seeking outside of the current block doesn't update actual data,
so getByte()/etc will get wrong data from stalled buffer.
parent 6316b3ed
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment