From 7b825fb44b9fdeb7ccdeb468d0a9242c804586e6 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sun, 23 Jul 2023 10:44:52 -0400 Subject: [PATCH] LibPDF: Replace two TODO()s with Error returns That way, we render an incomplete page and log a message instead of crashing the viewer application. Lets us survive e.g. page 489 of pdf_reference_1-7.pdf. --- Userland/Libraries/LibPDF/ColorSpace.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibPDF/ColorSpace.cpp b/Userland/Libraries/LibPDF/ColorSpace.cpp index 1f43048eb67..5c10ba435ce 100644 --- a/Userland/Libraries/LibPDF/ColorSpace.cpp +++ b/Userland/Libraries/LibPDF/ColorSpace.cpp @@ -40,7 +40,7 @@ PDFErrorOr> ColorSpace::create(DeprecatedFlyString con if (name == CommonNames::DeviceCMYK) return DeviceCMYKColorSpace::the(); if (name == CommonNames::Pattern) - TODO(); + return Error::rendering_unsupported_error("Pattern color spaces not yet implemented"); VERIFY_NOT_REACHED(); } @@ -60,7 +60,7 @@ PDFErrorOr> ColorSpace::create(Document* document, Non return TRY(ICCBasedColorSpace::create(document, move(parameters))); dbgln("Unknown color space: {}", color_space_name); - TODO(); + return Error::rendering_unsupported_error("unknown color space"); } NonnullRefPtr DeviceGrayColorSpace::the()