Skip to content

Commit

Permalink
LibPDF: Replace two TODO()s with Error returns
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nico authored and trflynn89 committed Jul 23, 2023
1 parent 268355c commit 7b825fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Userland/Libraries/LibPDF/ColorSpace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ PDFErrorOr<NonnullRefPtr<ColorSpace>> 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();
}

Expand All @@ -60,7 +60,7 @@ PDFErrorOr<NonnullRefPtr<ColorSpace>> 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> DeviceGrayColorSpace::the()
Expand Down

0 comments on commit 7b825fb

Please sign in to comment.