From 1ad67cfe58963c29762dc28676bdca2afba803a4 Mon Sep 17 00:00:00 2001 From: Artem Strygin Date: Thu, 31 Aug 2017 16:53:09 +0300 Subject: Remove redundant code. Do not check recursive parsing of same object in CPDF_SyntaxParser, because this problem is solved in CPDF_IndirectObjectHolder. (See https://pdfium-review.googlesource.com/c/pdfium/+/12590) Change-Id: I7829e06ae5eb06e85a0c8cfe22c1c428b55bb692 Reviewed-on: https://pdfium-review.googlesource.com/12610 Commit-Queue: Art Snake Reviewed-by: dsinclair --- core/fpdfapi/parser/cpdf_syntax_parser.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'core') diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp index 73932494c0..c3ebbdaee9 100644 --- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp +++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp @@ -592,14 +592,8 @@ std::unique_ptr CPDF_SyntaxParser::ReadStream( std::unique_ptr pDict, uint32_t objnum, uint32_t gennum) { - CPDF_Object* pLenObj = pDict->GetObjectFor("Length"); - FX_FILESIZE len = -1; - CPDF_Reference* pLenObjRef = ToReference(pLenObj); - - bool differingObjNum = !pLenObjRef || (pLenObjRef->GetObjList() && - pLenObjRef->GetRefObjNum() != objnum); - if (pLenObj && differingObjNum) - len = pLenObj->GetInteger(); + const CPDF_Number* pLenObj = ToNumber(pDict->GetDirectObjectFor("Length")); + FX_FILESIZE len = pLenObj ? pLenObj->GetInteger() : -1; // Locate the start of stream. ToNextLine(); -- cgit v1.2.3