mirror of
https://github.com/opencv/opencv.git
synced 2025-06-28 07:23:30 +08:00
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.
This commit is contained in:
parent
6316b3ed91
commit
6dfb6a3016
@ -175,8 +175,11 @@ void RBaseStream::setPos( int pos )
|
|||||||
}
|
}
|
||||||
|
|
||||||
int offset = pos % m_block_size;
|
int offset = pos % m_block_size;
|
||||||
|
int old_block_pos = m_block_pos;
|
||||||
m_block_pos = pos - offset;
|
m_block_pos = pos - offset;
|
||||||
m_current = m_start + offset;
|
m_current = m_start + offset;
|
||||||
|
if (old_block_pos != m_block_pos)
|
||||||
|
readBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user