A few UB fixes (#1272)

* Fix OoB in ObjDriftie

* Fix OoB in EnHorseLinkChild

* Fix negative shift in jpegdecode

* more oob fixes

* AVOID_UB

* clean

* huh?

* change viint.h macros

* objdriftice

* ub labelling

* review

* review

* fix z_parameter arrays

* u32 cast

* missing &
This commit is contained in:
Anghelo Carvajal
2023-06-24 04:40:26 -04:00
committed by GitHub
parent 19da43859e
commit 9b341a4d6a
10 changed files with 86 additions and 59 deletions
+1 -1
View File
@@ -156,7 +156,7 @@ s32 JpegDecoder_ParseNextSymbol(JpegHuffmanTable* hTable, s16* outCoeff, s8* out
if (sym) {
*outCoeff = JpegDecoder_ReadBits(sym);
if (*outCoeff < (1 << (sym - 1))) {
*outCoeff += (-1 << sym) + 1;
*outCoeff += (0xFFFFFFFF << sym) + 1;
}
}