summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorLucas CHOLLET <lucas.chollet@free.fr>2023-02-25 15:15:55 -0500
committerAndreas Kling <kling@serenityos.org>2023-02-27 13:39:22 +0100
commit698605444bca42d2e7a1841aa82580b9b488b0de (patch)
tree4eee0874e7ecdb064149482133f30b9f5646a1b8 /Userland
parentd3231ca323f52de6de5a88772de9aa09697cf989 (diff)
downloadserenity-698605444bca42d2e7a1841aa82580b9b488b0de.zip
LibGfx: Remove restrictive checks
These checks are only valid for mono-scan SOF0 images, with tables defined before the start of frame segment.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibGfx/JPEGLoader.cpp21
1 files changed, 1 insertions, 20 deletions
diff --git a/Userland/Libraries/LibGfx/JPEGLoader.cpp b/Userland/Libraries/LibGfx/JPEGLoader.cpp
index a9088ac2ff..adb41b0d70 100644
--- a/Userland/Libraries/LibGfx/JPEGLoader.cpp
+++ b/Userland/Libraries/LibGfx/JPEGLoader.cpp
@@ -553,11 +553,7 @@ static ErrorOr<void> read_start_of_scan(AK::SeekableStream& stream, JPEGLoadingC
u16 bytes_to_read = TRY(stream.read_value<BigEndian<u16>>()) - 2;
TRY(ensure_bounds_okay(TRY(stream.tell()), bytes_to_read, context.data_size));
- u8 component_count = TRY(stream.read_value<u8>());
- if (component_count != context.components.size()) {
- dbgln_if(JPEG_DEBUG, "{}: Unsupported number of components: {}!", TRY(stream.tell()), component_count);
- return Error::from_string_literal("Unsupported number of components");
- }
+ [[maybe_unused]] u8 const component_count = TRY(stream.read_value<u8>());
Scan current_scan;
@@ -573,21 +569,6 @@ static ErrorOr<void> read_start_of_scan(AK::SeekableStream& stream, JPEGLoadingC
ScanComponent scan_component { component, static_cast<u8>(table_ids >> 4), static_cast<u8>(table_ids & 0x0F) };
- if (context.dc_tables.size() != context.ac_tables.size()) {
- dbgln_if(JPEG_DEBUG, "{}: DC & AC table count mismatch!", TRY(stream.tell()));
- return Error::from_string_literal("DC & AC table count mismatch");
- }
-
- if (!context.dc_tables.contains(scan_component.dc_destination_id)) {
- dbgln_if(JPEG_DEBUG, "DC table (id: {}) does not exist!", scan_component.dc_destination_id);
- return Error::from_string_literal("DC table does not exist");
- }
-
- if (!context.ac_tables.contains(scan_component.ac_destination_id)) {
- dbgln_if(JPEG_DEBUG, "AC table (id: {}) does not exist!", scan_component.ac_destination_id);
- return Error::from_string_literal("AC table does not exist");
- }
-
current_scan.components.append(scan_component);
}