mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-27 13:11:46 +03: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
Notes:
sideshowbarker
2024-07-16 23:08:48 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/7dfa5fc1dc Pull-request: https://github.com/SerenityOS/serenity/pull/20172
@ -271,7 +271,7 @@ PDFErrorOr<ByteBuffer> Filter::decode_jbig2(ReadonlyBytes)
|
||||
PDFErrorOr<ByteBuffer> Filter::decode_dct(ReadonlyBytes bytes)
|
||||
{
|
||||
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));
|
||||
return TRY(frame.image->serialize_to_byte_buffer());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user