From cdb403fb433604224c95c1449c9e01a1d84f30e9 Mon Sep 17 00:00:00 2001 From: Peter Brant Date: Tue, 9 May 2017 16:33:45 +0200 Subject: [PATCH] Fix fallback to JavaScript image decoder The bytes property will read the underlying stream to the end. Reset in case the image decoder hasn't finished initializing. --- src/core/evaluator.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/evaluator.js b/src/core/evaluator.js index 00f6f6566f5c5..0c776882f301a 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -58,6 +58,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { } var page = image.bytes; + image.stream.reset(); var data; if (globals) { @@ -74,6 +75,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { var jpxImageRequest = function() { var ary = image.bytes; + image.stream.reset(); var cs = image.dict.get('ColorSpace', 'CS'); return { action: 'DecodeJpxStream',