From c195daf85e40cdf403ff5aa4cfe67809e590d66c Mon Sep 17 00:00:00 2001 From: eug48 Date: Fri, 10 May 2013 13:26:28 +1000 Subject: [PATCH] Remove stream.parameters which wasn't being set consistently. Fixes issue #2881. --- src/obj.js | 8 ++++---- src/parser.js | 4 ++-- src/stream.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/obj.js b/src/obj.js index 7a7ee5463..09501a82a 100644 --- a/src/obj.js +++ b/src/obj.js @@ -550,7 +550,7 @@ var XRef = (function XRefClosure() { if (!('streamState' in this)) { // Stores state of the stream as we process it so we can resume // from middle of stream in case of missing data error - var streamParameters = stream.parameters; + var streamParameters = stream.dict; var byteWidths = streamParameters.get('W'); var range = streamParameters.get('Index'); if (!range) { @@ -567,7 +567,7 @@ var XRef = (function XRefClosure() { this.readXRefStream(stream); delete this.streamState; - return stream.parameters; + return stream.dict; }, readXRefStream: function XRef_readXRefStream(stream) { @@ -903,8 +903,8 @@ var XRef = (function XRefClosure() { stream = this.fetch(new Ref(tableOffset, 0)); if (!isStream(stream)) error('bad ObjStm stream'); - var first = stream.parameters.get('First'); - var n = stream.parameters.get('N'); + var first = stream.dict.get('First'); + var n = stream.dict.get('N'); if (!isInt(first) || !isInt(n)) { error('invalid first and n parameters for ObjStm stream'); } diff --git a/src/parser.js b/src/parser.js index 97b9b1b1e..a0f6c295e 100644 --- a/src/parser.js +++ b/src/parser.js @@ -180,7 +180,7 @@ var Parser = (function ParserClosure() { if (cipherTransform) imageStream = cipherTransform.createStream(imageStream); imageStream = this.filter(imageStream, dict, length); - imageStream.parameters = dict; + imageStream.dict = dict; this.buf2 = Cmd.get('EI'); this.shift(); @@ -216,7 +216,7 @@ var Parser = (function ParserClosure() { if (cipherTransform) stream = cipherTransform.createStream(stream); stream = this.filter(stream, dict, length); - stream.parameters = dict; + stream.dict = dict; return stream; }, filter: function Parser_filter(stream, dict, length) { diff --git a/src/stream.js b/src/stream.js index bca26517d..6320c6fc0 100644 --- a/src/stream.js +++ b/src/stream.js @@ -26,7 +26,7 @@ var Stream = (function StreamClosure() { this.start = start || 0; this.pos = this.start; this.end = (start + length) || this.bytes.length; - this.parameters = this.dict = dict; + this.dict = dict; } // required methods for a stream. if a particular stream does not