Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Unified Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp

Issue 1710403002: Use safe arithmentic in CFX_BinaryBuf::ExpandBuf. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: needless uint8_t casts. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/include/fxcrt/fx_safe_types.h ('k') | core/src/fxcodec/codec/fx_codec_fax.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
index 735cd2b38a0415886702ff66bf7c5375bd686f05..d52ef4fd34de2782a3fd8eb4fd678f8febd59a65 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();
}
« no previous file with comments | « core/include/fxcrt/fx_safe_types.h ('k') | core/src/fxcodec/codec/fx_codec_fax.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698