refuse to load file exceeding 9999x9999 pixels.
Prevent crashing when a GIf file pretends to be 50000x50000
This commit is contained in:
parent
3bfa777d23
commit
617e4da310
@ -335,6 +335,12 @@ void Pre_load(T_IO_Context *context, short width, short height, long file_size,
|
||||
char str[10];
|
||||
byte truecolor;
|
||||
|
||||
if (width < 0 || width > 9999 || height < 0 || height > 9999)
|
||||
{
|
||||
File_error = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (bpp == 0)
|
||||
bpp = 8; // default to 8bits
|
||||
truecolor = (bpp > 8) ? 1 : 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user