mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:17:34 +00:00
LibGfx: Make all image decoders reject image sizes above 16384 pixels
Let's just say no to shenanigans by capping images at 16384 pixels both wide and tall. If a day comes in the future where we need to handle images larger than this, we can deal with it then.
This commit is contained in:
parent
a5f4cb78cf
commit
edf01803cd
7 changed files with 38 additions and 10 deletions
|
@ -776,6 +776,12 @@ static bool read_start_of_frame(InputMemoryStream& stream, JPGLoadingContext& co
|
|||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
if (context.frame.width > maximum_width_for_decoded_images || context.frame.height > maximum_height_for_decoded_images) {
|
||||
dbgln("This JPEG is too large for comfort: {}x{}", context.frame.width, context.frame.height);
|
||||
return false;
|
||||
}
|
||||
|
||||
set_macroblock_metadata(context);
|
||||
|
||||
stream >> context.component_count;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue