summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page/pageint.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2015-10-28 13:05:52 -0400
committerDan Sinclair <dsinclair@chromium.org>2015-10-28 13:05:52 -0400
commit90c90059131c0412ebefddb6a97084c4776a3c4e (patch)
tree25a75672be2ce7b7bceb377ef04624ea5f149229 /core/src/fpdfapi/fpdf_page/pageint.h
parentaad3828aea84b504f98ddc94a11d88907f3144d9 (diff)
downloadpdfium-90c90059131c0412ebefddb6a97084c4776a3c4e.tar.xz
Merge to XFA: Add PositionIsInBounds to CPDF_StreamParser
This Cl moves all of the m_Size <= m_Pos and m_Pos >= m_Size checks to an PositionIsInBounds() helper. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1412793008 . (cherry picked from commit b9d06fb2186d7002d6231d1805bcf97fc60144c5) Review URL: https://codereview.chromium.org/1414163007 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_page/pageint.h')
-rw-r--r--core/src/fpdfapi/fpdf_page/pageint.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/src/fpdfapi/fpdf_page/pageint.h b/core/src/fpdfapi/fpdf_page/pageint.h
index c85523b833..1b41633346 100644
--- a/core/src/fpdfapi/fpdf_page/pageint.h
+++ b/core/src/fpdfapi/fpdf_page/pageint.h
@@ -45,11 +45,19 @@ class CPDF_StreamParser {
CFX_ByteString ReadString();
CFX_ByteString ReadHexString();
const uint8_t* m_pBuf;
+
+ // Length in bytes of m_pBuf.
FX_DWORD m_Size;
+
+ // Current byte position within m_pBuf.
FX_DWORD m_Pos;
+
uint8_t m_WordBuffer[256];
FX_DWORD m_WordSize;
CPDF_Object* m_pLastObj;
+
+ private:
+ bool PositionIsInBounds() const;
};
typedef enum {
PDFOP_CloseFillStrokePath = 0,