mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 00:56:39 +00:00
LibGfx/PNG: Reject files that doesn't start with a IHDr chunk
This commit is contained in:
parent
8d907b6535
commit
a173275afa
Notes:
sideshowbarker
2024-07-18 03:23:00 +09:00
Author: https://github.com/LucasChollet
Commit: a173275afa
Pull-request: https://github.com/SerenityOS/serenity/pull/20066
1 changed files with 4 additions and 0 deletions
|
@ -1212,6 +1212,10 @@ static ErrorOr<void> process_chunk(Streamer& streamer, PNGLoadingContext& contex
|
|||
|
||||
if (chunk_type == "IHDR"sv)
|
||||
return process_IHDR(chunk_data, context);
|
||||
|
||||
if (context.state < PNGLoadingContext::IHDRDecoded)
|
||||
return Error::from_string_literal("IHDR is not the first chunk of the file");
|
||||
|
||||
if (chunk_type == "IDAT"sv)
|
||||
return process_IDAT(chunk_data, context);
|
||||
if (chunk_type == "PLTE"sv)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue