From 66fdbd0342ba6f623c03132713b82bfd26ffad5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Sat, 12 Mar 2022 21:10:24 +0100 Subject: [PATCH] Always check Length value for stream parsing wether or not it has filter --- src/uPDFParser.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/uPDFParser.cpp b/src/uPDFParser.cpp index 1c45bf6..1cc21e5 100644 --- a/src/uPDFParser.cpp +++ b/src/uPDFParser.cpp @@ -572,8 +572,7 @@ namespace uPDFParser EXCEPTION(INVALID_STREAM, "No Length property at offset " << curOffset); DataType* Length = (*object)["Length"]; - // Try with a direct jump if no filter applied (Flatedecode) - if (!object->hasKey("Filter") && Length->type() == DataType::INTEGER) + if (Length->type() == DataType::INTEGER) { Integer* length = (Integer*)Length; endOffset = startOffset + length->value();