mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-19 15:58:56 +00:00
LibGfx/JPEG2000: Add two spec comments
This commit is contained in:
parent
7b7ef7dcc7
commit
0df01dea4a
Notes:
sideshowbarker
2024-07-17 09:49:33 +09:00
Author: https://github.com/nico
Commit: 0df01dea4a
Pull-request: https://github.com/SerenityOS/serenity/pull/23901
Reviewed-by: https://github.com/trflynn89 ✅
1 changed files with 3 additions and 0 deletions
|
@ -555,11 +555,14 @@ static ErrorOr<void> parse_codestream_main_header(JPEG2000LoadingContext& contex
|
||||||
}
|
}
|
||||||
case J2K_SOT: {
|
case J2K_SOT: {
|
||||||
// SOT terminates the main header.
|
// SOT terminates the main header.
|
||||||
|
// A.4.2: "There shall be at least one SOT in a codestream."
|
||||||
if (!saw_COD_marker)
|
if (!saw_COD_marker)
|
||||||
return Error::from_string_literal("JPEG2000ImageDecoderPlugin: Required COD marker not present in main header");
|
return Error::from_string_literal("JPEG2000ImageDecoderPlugin: Required COD marker not present in main header");
|
||||||
if (!saw_QCD_marker)
|
if (!saw_QCD_marker)
|
||||||
return Error::from_string_literal("JPEG2000ImageDecoderPlugin: Required QCD marker not present in main header");
|
return Error::from_string_literal("JPEG2000ImageDecoderPlugin: Required QCD marker not present in main header");
|
||||||
|
|
||||||
|
// A.6.4: "there is not necessarily a correspondence with the number of sub-bands present because the sub-bands
|
||||||
|
// can be truncated with no requirement to correct [the QCD] marker segment."
|
||||||
size_t step_sizes_count = context.qcd.step_sizes.visit(
|
size_t step_sizes_count = context.qcd.step_sizes.visit(
|
||||||
[](Empty) -> size_t { VERIFY_NOT_REACHED(); },
|
[](Empty) -> size_t { VERIFY_NOT_REACHED(); },
|
||||||
[](Vector<QuantizationDefault::ReversibleStepSize> const& step_sizes) { return step_sizes.size(); },
|
[](Vector<QuantizationDefault::ReversibleStepSize> const& step_sizes) { return step_sizes.size(); },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue