mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 11:45:53 +01:00
Properly read the sign bit
This commit is contained in:
parent
ca5b7d72c4
commit
9bfc7e8b89
@ -125,14 +125,12 @@ bool HuffmanDeltaStream<BitStream>::readDelta(int sign, qint32 &delta)
|
||||
return false;
|
||||
|
||||
if (symbol && !sign) {
|
||||
if (!this->_symbolDataSize)
|
||||
quint32 bit;
|
||||
if (!this->read(1, bit))
|
||||
return false;
|
||||
else {
|
||||
sign = ((1U << (this->_symbolDataSize - 1)) & this->_symbolData)
|
||||
? -1 : 1;
|
||||
this->_symbolDataSize--;
|
||||
}
|
||||
sign = bit ? -1 : 1;
|
||||
}
|
||||
|
||||
delta = sign * symbol;
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user