diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-04-06 23:48:24 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-06 23:48:24 +0000 |
commit | 6058efdbdc186e120e7e2121c290ac4d820ffbf8 (patch) | |
tree | 8944872de2d924d3efd76266cc929c6f25199134 /core/fpdfapi/page/cpdf_streamcontentparser.cpp | |
parent | 2aa01f5ccbf1464b43527c1ffa6b42bafed9ebeb (diff) | |
download | pdfium-6058efdbdc186e120e7e2121c290ac4d820ffbf8.tar.xz |
Add span.h from chromium base.chromium/3392
Allows indexing with better bounds-checking to occur. Some small
modifications are required to deal with PDFium being intentionally
held at C++11 compliance, not C++14.
Use in one place as check on correctness.
Change-Id: Id2875cf0a93980112bc536a93c4f9ec5306c0dac
Reviewed-on: https://pdfium-review.googlesource.com/29671
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Chris Palmer <palmer@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_streamcontentparser.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_streamcontentparser.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp index 697349e987..c251c5ec66 100644 --- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp +++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp @@ -37,6 +37,7 @@ #include "core/fxge/cfx_graphstatedata.h" #include "third_party/base/logging.h" #include "third_party/base/ptr_util.h" +#include "third_party/base/span.h" #include "third_party/base/stl_util.h" namespace { @@ -1515,7 +1516,8 @@ uint32_t CPDF_StreamContentParser::Parse(const uint8_t* pData, pData); uint32_t InitObjCount = m_pObjectHolder->GetPageObjectList()->size(); - CPDF_StreamParser syntax(pData, dwSize, m_pDocument->GetByteStringPool()); + CPDF_StreamParser syntax(pdfium::make_span(pData, dwSize), + m_pDocument->GetByteStringPool()); CPDF_StreamParserAutoClearer auto_clearer(&m_pSyntax, &syntax); while (1) { uint32_t cost = m_pObjectHolder->GetPageObjectList()->size() - InitObjCount; |