1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +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:
Andreas Kling 2020-12-25 00:19:06 +01:00
parent a5f4cb78cf
commit edf01803cd
7 changed files with 38 additions and 10 deletions

View file

@ -424,6 +424,11 @@ static bool load_gif_frame_descriptors(GIFLoadingContext& context)
if (stream.handle_any_error())
return false;
if (context.logical_screen.width > maximum_width_for_decoded_images || context.logical_screen.height > maximum_height_for_decoded_images) {
dbgln("This GIF is too large for comfort: {}x{}", context.logical_screen.width, context.logical_screen.height);
return false;
}
u8 gcm_info = 0;
stream >> gcm_info;