Skip to content

Commit

Permalink
LibGfx/ILBM: Explicitly fail decoding if body chunk isn't present
Browse files Browse the repository at this point in the history
Previously, the decoder would crash in this case.
  • Loading branch information
tcl3 authored and awesomekling committed Oct 17, 2023
1 parent cb96110 commit f4a89c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Userland/Libraries/LibGfx/ImageFormats/ILBMLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ static ErrorOr<void> decode_iff_chunks(ILBMLoadingContext& context)
}
}

if (context.state != ILBMLoadingContext::State::BitmapDecoded)
return Error::from_string_literal("Missing body chunk");

return {};
}

Expand Down

0 comments on commit f4a89c3

Please sign in to comment.