diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-09-12 16:19:22 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-09-12 16:19:22 +0000 |
commit | 657a1aa0700b437bd159007a97c8219c50c461a7 (patch) | |
tree | 459aa2803a2115a853c07882de2aefde0402c7b8 /core/fpdfapi/page/cpdf_streamcontentparser.h | |
parent | 5c86fd4c5110a99606316721786f1ba9bf0d855a (diff) | |
download | pdfium-657a1aa0700b437bd159007a97c8219c50c461a7.tar.xz |
Set correct stream index when parsing is done in several steps.
When parsing happens in several steps (in pages with > 100 page
objects), the position is reset to 0 and the start pointer is
advanced. This breaks the calculation of which stream an object
belongs to.
Passing in the base pointer separately from the start offset allows
the correct position to be calculated and the correct stream to be
identified.
Change-Id: Ic0d5f59f437609158aa97b3c8a18dbd48cd3b0d4
Reviewed-on: https://pdfium-review.googlesource.com/42270
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_streamcontentparser.h')
-rw-r--r-- | core/fpdfapi/page/cpdf_streamcontentparser.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.h b/core/fpdfapi/page/cpdf_streamcontentparser.h index aac66e883b..a129894dba 100644 --- a/core/fpdfapi/page/cpdf_streamcontentparser.h +++ b/core/fpdfapi/page/cpdf_streamcontentparser.h @@ -46,6 +46,7 @@ class CPDF_StreamContentParser { uint32_t Parse(const uint8_t* pData, uint32_t dwSize, + uint32_t start_offset, uint32_t max_cost, const std::vector<uint32_t>& stream_start_offsets); CPDF_PageObjectHolder* GetPageObjectHolder() const { @@ -237,7 +238,13 @@ class CPDF_StreamContentParser { std::vector<std::unique_ptr<CPDF_AllStates>> m_StateStack; float m_Type3Data[6]; ContentParam m_ParamBuf[kParamBufSize]; + + // The merged stream offsets at which a content stream ends and another + // begins. std::vector<uint32_t> m_StreamStartOffsets; + + // The merged stream offset at which the last |m_pSyntax| started parsing. + uint32_t m_StartParseOffset = 0; }; #endif // CORE_FPDFAPI_PAGE_CPDF_STREAMCONTENTPARSER_H_ |