summaryrefslogtreecommitdiff
path: root/fxbarcode/datamatrix/BC_EncoderContext.h
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-08-11 16:24:25 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-11 21:17:14 +0000
commit05ea7e1ae677d0d5872f7ccbaf28f594ad6d94d9 (patch)
tree614345906f074f412a56d398e2a7473071673e34 /fxbarcode/datamatrix/BC_EncoderContext.h
parentb1a794a9a2e5fcb8d69665bd347b349fecfe4877 (diff)
downloadpdfium-05ea7e1ae677d0d5872f7ccbaf28f594ad6d94d9.tar.xz
Remove potential out of bounds call to GetAt()
Since m_pos is passed into GetAt() on the underlying string in getCurrentChar(), the value of it needs to confirmed to be valid after decrementing. Some types were changed to reflect the values being stored. BUG=chromium:752480 Change-Id: Ib6d6f52326defd31785e70a17049a08b64dbe069 Reviewed-on: https://pdfium-review.googlesource.com/10652 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxbarcode/datamatrix/BC_EncoderContext.h')
-rw-r--r--fxbarcode/datamatrix/BC_EncoderContext.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/fxbarcode/datamatrix/BC_EncoderContext.h b/fxbarcode/datamatrix/BC_EncoderContext.h
index 4931501c45..ef4c38ebab 100644
--- a/fxbarcode/datamatrix/BC_EncoderContext.h
+++ b/fxbarcode/datamatrix/BC_EncoderContext.h
@@ -25,26 +25,26 @@ class CBC_EncoderContext {
wchar_t getCurrent();
void writeCodewords(const CFX_WideString& codewords);
void writeCodeword(wchar_t codeword);
- int32_t getCodewordCount();
+ FX_STRSIZE getCodewordCount();
void signalEncoderChange(int32_t encoding);
void resetEncoderSignal();
bool hasMoreCharacters();
- int32_t getRemainingCharacters();
+ FX_STRSIZE getRemainingCharacters();
void updateSymbolInfo(int32_t& e);
void updateSymbolInfo(int32_t len, int32_t& e);
void resetSymbolInfo();
CFX_WideString m_msg;
CFX_WideString m_codewords;
- int32_t m_pos;
+ FX_STRSIZE m_pos;
int32_t m_newEncoding;
CFX_UnownedPtr<CBC_SymbolInfo> m_symbolInfo;
private:
- int32_t getTotalMessageCharCount();
+ FX_STRSIZE getTotalMessageCharCount();
bool m_allowRectangular; // Force square when false.
- int32_t m_skipAtEnd;
+ FX_STRSIZE m_skipAtEnd;
};
#endif // FXBARCODE_DATAMATRIX_BC_ENCODERCONTEXT_H_