Skip to content

Commit e22466a

Browse files
committed
Revert commit 236cf65
1 parent da2e675 commit e22466a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/bitstream/DefaultInputBitStream.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,12 @@ uint DefaultInputBitStream::readBits(byte bits[], uint count)
103103
const uint64 v0 = _current;
104104

105105
if (_position + 32 > _maxPosition) {
106-
_availBits = pullCurrent() - r;
106+
_availBits = pullCurrent();
107107

108-
if (_availBits < 0)
108+
if (_availBits < r)
109109
throw BitStreamException("No more data to read in the bitstream", BitStreamException::END_OF_STREAM);
110110

111+
_availBits -= r;
111112
BigEndian::writeLong64(&bits[start], (v0 << r) | (_current >> _availBits));
112113
start += 8;
113114
remaining -= 64;

0 commit comments

Comments
 (0)