mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibGfx/ILBM: Don't attempt to decode a BODY chunk without a color map
While this isn't disallowed by the specification, it is not something we currently support. Instead of crashing we now return an error in this case.
This commit is contained in:
parent
75731f9c50
commit
bed7b33daa
Notes:
sideshowbarker
2024-07-17 05:13:53 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/bed7b33daa Pull-request: https://github.com/SerenityOS/serenity/pull/21699 Reviewed-by: https://github.com/warpdesign
1 changed files with 3 additions and 0 deletions
|
@ -298,6 +298,9 @@ static ErrorOr<void> decode_iff_chunks(ILBMLoadingContext& context)
|
|||
if (chunk.type == FourCC("CMAP")) {
|
||||
context.color_table = TRY(decode_cmap_chunk(chunk));
|
||||
} else if (chunk.type == FourCC("BODY")) {
|
||||
if (context.color_table.is_empty())
|
||||
return Error::from_string_literal("Decoding BODY chunk without a color map is not currently supported");
|
||||
|
||||
TRY(decode_body_chunk(chunk, context));
|
||||
context.state = ILBMLoadingContext::State::BitmapDecoded;
|
||||
} else if (chunk.type == FourCC("CRNG")) {
|
||||
|
|
Loading…
Reference in a new issue