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:
parent
8b79e49a0f
commit
dd2c369df3
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user