mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:07:45 +00:00
LibPDF: Make JPEG decoding errors not assert
Instead, they're now turned into a diagnostic like other rendering problems, looking like so: Internal error while processing PDF file: Unsupported chroma subsampling factors Makes us no longer crash rendering page 1141 of pdf_reference_1.7-pdf.
This commit is contained in:
parent
d6ddc25975
commit
7dfa5fc1dc
1 changed files with 1 additions and 1 deletions
|
@ -271,7 +271,7 @@ PDFErrorOr<ByteBuffer> Filter::decode_jbig2(ReadonlyBytes)
|
||||||
PDFErrorOr<ByteBuffer> Filter::decode_dct(ReadonlyBytes bytes)
|
PDFErrorOr<ByteBuffer> Filter::decode_dct(ReadonlyBytes bytes)
|
||||||
{
|
{
|
||||||
if (Gfx::JPEGImageDecoderPlugin::sniff({ bytes.data(), bytes.size() })) {
|
if (Gfx::JPEGImageDecoderPlugin::sniff({ bytes.data(), bytes.size() })) {
|
||||||
auto decoder = Gfx::JPEGImageDecoderPlugin::create({ bytes.data(), bytes.size() }).release_value_but_fixme_should_propagate_errors();
|
auto decoder = TRY(Gfx::JPEGImageDecoderPlugin::create({ bytes.data(), bytes.size() }));
|
||||||
auto frame = TRY(decoder->frame(0));
|
auto frame = TRY(decoder->frame(0));
|
||||||
return TRY(frame.image->serialize_to_byte_buffer());
|
return TRY(frame.image->serialize_to_byte_buffer());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue