summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page/pageint.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2015-10-28 12:57:00 -0400
committerDan Sinclair <dsinclair@chromium.org>2015-10-28 12:57:00 -0400
commitb9d06fb2186d7002d6231d1805bcf97fc60144c5 (patch)
tree5f267e5000316f144bb1607ab1dc41cdda44f2db /core/src/fpdfapi/fpdf_page/pageint.h
parente3e5675bcdd26b8df7286e10a42d585df6d2321d (diff)
downloadpdfium-b9d06fb2186d7002d6231d1805bcf97fc60144c5.tar.xz
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. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1412793008 .
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,