From cf705eb2355f110a02141abfcd965491c53f1a0b Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sun, 22 Oct 2023 21:39:29 -0400 Subject: [PATCH] LibPDF: Use TRY() to get decompression result Makes us die with a better error message for some PDFs. --- Userland/Libraries/LibPDF/Filter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibPDF/Filter.cpp b/Userland/Libraries/LibPDF/Filter.cpp index ba6ee988e4..7d5b3936ab 100644 --- a/Userland/Libraries/LibPDF/Filter.cpp +++ b/Userland/Libraries/LibPDF/Filter.cpp @@ -212,7 +212,7 @@ PDFErrorOr Filter::decode_lzw(ReadonlyBytes) PDFErrorOr 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;