mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
LibGfx/PNG: Don't try to guess if IHDR has been decoded
This commit is contained in:
parent
07d3232f2d
commit
07f72b6d41
Notes:
sideshowbarker
2024-07-17 06:54:15 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/07f72b6d41 Pull-request: https://github.com/SerenityOS/serenity/pull/20066
@ -630,10 +630,8 @@ static bool decode_png_ihdr(PNGLoadingContext& context)
|
||||
|
||||
context.data_current_ptr = streamer.current_data_ptr();
|
||||
|
||||
if (context.width && context.height) {
|
||||
context.state = PNGLoadingContext::State::IHDRDecoded;
|
||||
if (context.state == PNGLoadingContext::State::IHDRDecoded)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -1018,6 +1016,9 @@ static ErrorOr<void> process_IHDR(ReadonlyBytes data, PNGLoadingContext& context
|
||||
default:
|
||||
return Error::from_string_literal("Unsupported color type");
|
||||
}
|
||||
|
||||
context.state = PNGLoadingContext::IHDRDecoded;
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user