Fix shifting bits out of byte in tr_font.c

Found using LLVM sanitizer. Reported by Dominic "lonkamikaze" Fandrey.
This commit is contained in:
Zack Middleton 2018-04-08 21:10:04 -05:00
parent a494edeb94
commit ae9edd1491

View file

@ -303,7 +303,7 @@ static int fdOffset;
static byte *fdFile;
int readInt( void ) {
int i = fdFile[fdOffset]+(fdFile[fdOffset+1]<<8)+(fdFile[fdOffset+2]<<16)+(fdFile[fdOffset+3]<<24);
int i = ((unsigned int)fdFile[fdOffset] | ((unsigned int)fdFile[fdOffset+1]<<8) | ((unsigned int)fdFile[fdOffset+2]<<16) | ((unsigned int)fdFile[fdOffset+3]<<24));
fdOffset += 4;
return i;
}