diff options
author | Artem Strygin <art-snake@yandex-team.ru> | 2017-08-31 16:53:09 +0300 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-05 16:56:47 +0000 |
commit | 1ad67cfe58963c29762dc28676bdca2afba803a4 (patch) | |
tree | 2152b696b72d0b69c9712549110e787e220fc01b | |
parent | 0e3a4ffcd73dab2a7d5534b7b97cb5e0a0a2edf9 (diff) | |
download | pdfium-1ad67cfe58963c29762dc28676bdca2afba803a4.tar.xz |
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 <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
-rw-r--r-- | core/fpdfapi/parser/cpdf_syntax_parser.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
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_Stream> CPDF_SyntaxParser::ReadStream( std::unique_ptr<CPDF_Dictionary> 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(); |