summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-09-15 14:16:22 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-09-15 21:37:14 +0000
commitfc556ac0c823bccffaff84fea7a118835f33147a (patch)
tree85231b787316e9a1cd03200406956c4a862b5b1b
parent47a90b894ecca2d3547226169602d7f8729d564f (diff)
downloadpdfium-fc556ac0c823bccffaff84fea7a118835f33147a.tar.xz
M62: Fix an off by 1 error in TIFF_PredictLine().
BUG=chromium:762106 TBR=tsepez@chromium.org Change-Id: I714d69320cc4fb81d535f811c18d4ef91fec44d3 Reviewed-on: https://pdfium-review.googlesource.com/13212 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> (cherry picked from commit 131c0eb2e34ece6ede6288842cb3004ec3c600d4) Reviewed-on: https://pdfium-review.googlesource.com/14190 Reviewed-by: Lei Zhang <thestig@chromium.org>
-rw-r--r--core/fxcodec/codec/fx_codec_flate.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/fxcodec/codec/fx_codec_flate.cpp b/core/fxcodec/codec/fx_codec_flate.cpp
index 02be295ce6..6482d52ed8 100644
--- a/core/fxcodec/codec/fx_codec_flate.cpp
+++ b/core/fxcodec/codec/fx_codec_flate.cpp
@@ -472,7 +472,7 @@ void TIFF_PredictLine(uint8_t* dest_buf,
}
int BytesPerPixel = BitsPerComponent * Colors / 8;
if (BitsPerComponent == 16) {
- for (uint32_t i = BytesPerPixel; i < row_size; i += 2) {
+ for (uint32_t i = BytesPerPixel; i + 1 < row_size; i += 2) {
uint16_t pixel =
(dest_buf[i - BytesPerPixel] << 8) | dest_buf[i - BytesPerPixel + 1];
pixel += (dest_buf[i] << 8) | dest_buf[i + 1];