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
commit bbf66ea055
Notes: sideshowbarker 2024-07-17 03:19:14 +09:00
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");