1
0
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:
Martin Tůma 2021-11-08 22:10:36 +01:00
parent ca5b7d72c4
commit 9bfc7e8b89

View File

@ -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;