Commit 58e056c4 authored by Albert Astals Cid's avatar Albert Astals Cid

Revert 31c3832b

So shifting left negative values is undefined behaviour according to the
spec but if we don't do it we break, so we seem to be depending on this
undefined behaviour, will try to figure out a better fix
parent a6c2eb67
......@@ -1445,9 +1445,7 @@ int LZWStream::getCode() {
while (inputBits < nextBits) {
if ((c = str->getChar()) == EOF)
return EOF;
if (likely(inputBuf >= 0)) {
inputBuf = (inputBuf << 8) | (c & 0xff);
}
inputBuf = (inputBuf << 8) | (c & 0xff);
inputBits += 8;
}
code = (inputBuf >> (inputBits - nextBits)) & ((1 << nextBits) - 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment