1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:37:37 +00:00

LibGfx: Remove maximum size limit for decoded images

It is unlikely this is needed anymore, and as pointed out things should
now safely return OOM if the bitmap is too large to allocate.

Also, no recently added decoders respected this limit anyway.

Fixes #20872
This commit is contained in:
MacDue 2023-09-01 22:58:35 +01:00 committed by Andreas Kling
parent 13d1c37ea0
commit bbf66ea055
6 changed files with 0 additions and 28 deletions

View file

@ -933,11 +933,6 @@ static ErrorOr<void> process_IHDR(ReadonlyBytes data, PNGLoadingContext& context
auto const& ihdr = *(const PNG_IHDR*)data.data();
if (ihdr.width > maximum_width_for_decoded_images || ihdr.height > maximum_height_for_decoded_images) {
dbgln("This PNG is too large for comfort: {}x{}", (u32)ihdr.width, (u32)ihdr.height);
return Error::from_string_literal("This PNG is too large for comfort");
}
if (!is_valid_compression_method(ihdr.compression_method)) {
dbgln("PNG has invalid compression method {}", ihdr.compression_method);
return Error::from_string_literal("Unsupported compression method");