From eaa568210f6285180456de7ecf4080ca912dd6d5 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 12 Feb 2024 19:37:06 -0500 Subject: [PATCH] LibPDF: Split CCITT errors by group --- Userland/Libraries/LibPDF/Filter.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibPDF/Filter.cpp b/Userland/Libraries/LibPDF/Filter.cpp index 5d247646cd..8f9f524b4a 100644 --- a/Userland/Libraries/LibPDF/Filter.cpp +++ b/Userland/Libraries/LibPDF/Filter.cpp @@ -306,7 +306,6 @@ PDFErrorOr Filter::decode_ccitt(ReadonlyBytes, RefPtr de } // FIXME: Do something with these. - (void)k; (void)require_end_of_line; (void)encoded_byte_align; (void)columns; @@ -315,7 +314,11 @@ PDFErrorOr Filter::decode_ccitt(ReadonlyBytes, RefPtr de (void)black_is_1; (void)damaged_rows_before_error; - return Error::rendering_unsupported_error("CCITTFaxDecode Filter is unsupported"); + if (k < 0) + return Error::rendering_unsupported_error("CCITTFaxDecode Filter Group 4 is unsupported"); + if (k == 0) + return Error::rendering_unsupported_error("CCITTFaxDecode Filter Group 3, 1-D is unsupported"); + return Error::rendering_unsupported_error("CCITTFaxDecode Filter Group 3, 2-D is unsupported"); } PDFErrorOr Filter::decode_jbig2(ReadonlyBytes)