mirror of
https://github.com/holub/mame
synced 2025-04-21 07:52:35 +03:00
util/bitstream.h: Adjust m_doffset based on m_dbitoffs when flushing. (#12060)
Fixes issues exposed when reading LaserDisc CHDs.
This commit is contained in:
parent
9827b7f547
commit
657c28b985
@ -175,6 +175,10 @@ inline uint32_t bitstream_in::read_offset() const
|
||||
result--;
|
||||
bits -= 8;
|
||||
}
|
||||
|
||||
if (m_dbitoffs > bits)
|
||||
result++;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -190,7 +194,11 @@ inline uint32_t bitstream_in::flush()
|
||||
m_doffset--;
|
||||
m_bits -= 8;
|
||||
}
|
||||
m_bits = m_buffer = 0;
|
||||
|
||||
if (m_dbitoffs > m_bits)
|
||||
m_doffset++;
|
||||
|
||||
m_bits = m_buffer = m_dbitoffs = 0;
|
||||
return m_doffset;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user