1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 11:18:13 +00:00

LibPDF: Use TRY() to get decompression result

Makes us die with a better error message for some PDFs.
This commit is contained in:
Nico Weber 2023-10-22 21:39:29 -04:00 committed by Tim Flynn
parent 6153dd7b84
commit cf705eb235

View file

@ -212,7 +212,7 @@ PDFErrorOr<ByteBuffer> Filter::decode_lzw(ReadonlyBytes)
PDFErrorOr<ByteBuffer> Filter::decode_flate(ReadonlyBytes bytes, int predictor, int columns, int colors, int bits_per_component)
{
auto buff = Compress::DeflateDecompressor::decompress_all(bytes.slice(2)).value();
auto buff = TRY(Compress::DeflateDecompressor::decompress_all(bytes.slice(2)));
if (predictor == 1)
return buff;