summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec
diff options
context:
space:
mode:
authorrbpotter <rbpotter@chromium.org>2017-01-23 16:41:08 -0800
committerCommit bot <commit-bot@chromium.org>2017-01-23 16:41:08 -0800
commit35a89dde15007d28c6796926708e8f0b5ee60d74 (patch)
tree4ca4868b489547e59ac77d6fa1c7b265c3ec0dd5 /core/fxcodec/codec
parent7a82a6294a34db85cf5cfa4b6a994708f7a915e7 (diff)
downloadpdfium-35a89dde15007d28c6796926708e8f0b5ee60d74.tar.xz
Fix bug found by fuzzer in A85 encoder (bad shift).
A85 encoder is not called yet; fix before adding calls to this code in Chromium. BUG=682550 Review-Url: https://codereview.chromium.org/2649263002
Diffstat (limited to 'core/fxcodec/codec')
-rw-r--r--core/fxcodec/codec/fx_codec.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/fxcodec/codec/fx_codec.cpp b/core/fxcodec/codec/fx_codec.cpp
index 23171cf3ea..3edf8924c3 100644
--- a/core/fxcodec/codec/fx_codec.cpp
+++ b/core/fxcodec/codec/fx_codec.cpp
@@ -229,7 +229,7 @@ bool CCodec_BasicModule::A85Encode(const uint8_t* src_buf,
uint32_t val = 0;
int count = 0;
while (pos < src_size) {
- val += (uint32_t)(src_buf[pos] << (8 * (3 - pos)));
+ val += (uint32_t)(src_buf[pos]) << (8 * (3 - count));
count++;
pos++;
}