[Pkg-javascript-commits] [pdf.js] 62/116: avoid out of range array access in JBIG2 decoder
David Prévot
taffit at moszumanska.debian.org
Fri Mar 6 16:20:01 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit 8013100ab87df53cd090742b44608d9b85d0dbf8
Author: fkaelberer <o_0_o at gmx.de>
Date: Fri Jan 23 09:13:50 2015 +0100
avoid out of range array access in JBIG2 decoder
---
src/core/jbig2.js | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/core/jbig2.js b/src/core/jbig2.js
index 0d846b5..ad3149c 100755
--- a/src/core/jbig2.js
+++ b/src/core/jbig2.js
@@ -179,10 +179,9 @@ var Jbig2Image = (function Jbig2ImageClosure() {
// At each pixel: Clear contextLabel pixels that are shifted
// out of the context, then add new ones.
- // If j + n is out of range at the right image border, then
- // the undefined value of bitmap[i - 2][j + n] is shifted to 0
contextLabel = ((contextLabel & OLD_PIXEL_MASK) << 1) |
- (row2[j + 3] << 11) | (row1[j + 4] << 4) | pixel;
+ (j + 3 < width ? row2[j + 3] << 11 : 0) |
+ (j + 4 < width ? row1[j + 4] << 4 : 0) | pixel;
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list