From 2a9fe573c04d02dac89bde9ff75ef198624fbbb2 Mon Sep 17 00:00:00 2001 From: p01 Date: Fri, 7 Mar 2014 11:51:04 +0100 Subject: [PATCH] Nest JBIG2 prediction if statements together ltp can only become truthy if predition is true. --- src/core/jbig2.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/jbig2.js b/src/core/jbig2.js index aad7d2922..111000886 100755 --- a/src/core/jbig2.js +++ b/src/core/jbig2.js @@ -269,10 +269,10 @@ var Jbig2Image = (function Jbig2ImageClosure() { if (prediction) { var sltp = decoder.readBit(contexts, pseudoPixelContext); ltp ^= sltp; - } - if (ltp) { - bitmap.push(bitmap[bitmap.length - 1]); // duplicate previous row - continue; + if (ltp) { + bitmap[i] = row;//bitmap[i - 1]); // duplicate previous row + continue; + } } var row = new Uint8Array(width); bitmap.push(row);