ICB: Fix Left Shift of Negative Value GCC Compiler Warning in NanoJPEG

This is emitted by GCC when -Wshift-negative-value is passed.

ICB has been tested and the jpeg backgrounds still decode as expected
with this change.
This commit is contained in:
D G Turner 2022-07-23 19:00:18 +01:00
parent cb949044db
commit f3b3d20f45

View File

@ -421,7 +421,7 @@ static int njGetVLC(nj_vlc_code_t *vlc, byte *code) {
return 0;
value = njGetBits(bits);
if (value < (1 << (bits - 1)))
value += ((-1) << bits) + 1;
value += (0xffffffff << bits) + 1;
return value;
}