diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-02-19 14:41:46 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-02-19 14:41:46 -0800 |
commit | 052a8d963af8bb186b956057763021624332c7a8 (patch) | |
tree | 280c161a4970231eff2496f57aa8445b6c2d5405 /core/src/fpdfapi | |
parent | ffc26c26f0ab004fbdb05195e1686d7f33983b06 (diff) | |
download | pdfium-052a8d963af8bb186b956057763021624332c7a8.tar.xz |
Revert "Revert "Use safe arithmentic in CFX_BinaryBuf::ExpandBuf.""
This relands the CL at https://codereview.chromium.org/1710403002
Tests passed locally.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1717603003 .
Diffstat (limited to 'core/src/fpdfapi')
-rw-r--r-- | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp index 735cd2b38a..d52ef4fd34 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp @@ -1873,7 +1873,7 @@ CFX_ByteString CPDF_SyntaxParser::ReadHexString() { if (!GetNextChar(ch)) return CFX_ByteString(); - CFX_BinaryBuf buf; + CFX_ByteTextBuf buf; bool bFirst = true; uint8_t code = 0; while (1) { @@ -1886,7 +1886,7 @@ CFX_ByteString CPDF_SyntaxParser::ReadHexString() { code = val * 16; } else { code += val; - buf.AppendByte((uint8_t)code); + buf.AppendByte(code); } bFirst = !bFirst; } @@ -1895,7 +1895,7 @@ CFX_ByteString CPDF_SyntaxParser::ReadHexString() { break; } if (!bFirst) - buf.AppendByte((uint8_t)code); + buf.AppendByte(code); return buf.GetByteString(); } |