Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't left-shift negative values to fix UBSAN warning
Instead, make the value positive, do the left-shift then, and make the result negative again afterwards: ``` ../3rdParty/jxrlib/image/decode/segdec.c:1081:36: runtime error: left shift of negative value -1 #0 0x7f0cc5c997c8 in DecodeMacroblockLowpass ../3rdParty/jxrlib/image/decode/segdec.c:1081 4creators#1 0x7f0cc5c2f4f4 in processMacroblockDec ../3rdParty/jxrlib/image/decode/strdec.c:417 4creators#2 0x7f0cc5c881f8 in ImageStrDecDecode ../3rdParty/jxrlib/image/decode/strdec.c:4010 4creators#3 0x7f0cc5b82102 in PKImageDecode_Copy_WMP ../3rdParty/jxrlib/jxrgluelib/JXRGlueJxr.c:1874 ``` Considering that the tests still pass, I think this is a safe solution to this warning.
- Loading branch information