From db140c844a119fc42d1b3312db3cd729f5651fb7 Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Tue, 27 May 2014 11:05:32 -0700 Subject: Use unsigned type for decoding in _A85Decode. The local variable res can overflow over 2^31-1 and so we must use unsigned type for decoding. BUG=none R=bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/288983009 --- core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/src') diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp index dfc26bc197..c395283fc3 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp @@ -44,7 +44,8 @@ FX_DWORD _A85Decode(const FX_BYTE* src_buf, FX_DWORD src_size, FX_LPBYTE& dest_b if (dest_buf == NULL) { return (FX_DWORD) - 1; } - int state = 0, res = 0; + int state = 0; + FX_UINT32 res = 0; pos = dest_size = 0; while (pos < src_size) { FX_BYTE ch = src_buf[pos++]; -- cgit v1.2.3