Merge pull request #2292 from saebekassebil/mozilla

Implement NullStream, fixes #1832
This commit is contained in:
Yury Delendik 2012-10-22 09:11:48 -07:00
commit 51e27537b4
2 changed files with 12 additions and 0 deletions

View File

@ -230,6 +230,9 @@ var Parser = (function ParserClosure() {
return stream; return stream;
}, },
makeFilter: function Parser_makeFilter(stream, name, length, params) { makeFilter: function Parser_makeFilter(stream, name, length, params) {
if (stream.dict.get('Length') === 0) {
return new NullStream(stream);
}
if (name == 'FlateDecode' || name == 'Fl') { if (name == 'FlateDecode' || name == 'Fl') {
if (params) { if (params) {
return new PredictorStream(new FlateStream(stream), params); return new PredictorStream(new FlateStream(stream), params);

View File

@ -2350,3 +2350,12 @@ var LZWStream = (function LZWStreamClosure() {
return LZWStream; return LZWStream;
})(); })();
var NullStream = (function NullStreamClosure() {
function NullStream() {
Stream.call(this, new Uint8Array(0));
}
NullStream.prototype = Stream.prototype;
return NullStream;
})();