mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +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;
|
return false;
|
||||||
|
|
||||||
if (symbol && !sign) {
|
if (symbol && !sign) {
|
||||||
if (!this->_symbolDataSize)
|
quint32 bit;
|
||||||
|
if (!this->read(1, bit))
|
||||||
return false;
|
return false;
|
||||||
else {
|
sign = bit ? -1 : 1;
|
||||||
sign = ((1U << (this->_symbolDataSize - 1)) & this->_symbolData)
|
|
||||||
? -1 : 1;
|
|
||||||
this->_symbolDataSize--;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delta = sign * symbol;
|
delta = sign * symbol;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user