2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-22 18:07:09 +01:00

engine: imagelib: fix integer overflow on huge images when calculating reflectivity

This commit is contained in:
Alibek Omarov 2024-02-17 22:14:27 +03:00
parent 8b79e49a0f
commit dd2c369df3
3 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ qboolean Image_LoadBMP( const char *name, const byte *buffer, fs_offset_t filesi
rgba_t palette[256] = { 0 };
int i, columns, column, rows, row, bpp = 1;
int cbPalBytes = 0, padSize = 0, bps = 0;
int reflectivity[3] = { 0, 0, 0 };
uint reflectivity[3] = { 0, 0, 0 };
qboolean load_qfont = false;
bmp_t bhdr;
fs_offset_t estimatedSize;

View File

@ -29,7 +29,7 @@ qboolean Image_LoadTGA( const char *name, const byte *buffer, fs_offset_t filesi
rgba_t palette[256];
byte red = 0, green = 0, blue = 0, alpha = 0;
int readpixelcount, pixelcount;
int reflectivity[3] = { 0, 0, 0 };
uint reflectivity[3] = { 0, 0, 0 };
qboolean compressed;
tga_t targa_header;

View File

@ -360,7 +360,7 @@ qboolean Image_LoadMIP( const char *name, const byte *buffer, fs_offset_t filesi
byte *fin, *pal;
int ofs[4], rendermode;
int i, pixels, numcolors;
int reflectivity[3] = { 0, 0, 0 };
uint reflectivity[3] = { 0, 0, 0 };
if( filesize < sizeof( mip ))
return false;