diff options
Diffstat (limited to 'core/decoders/tight.js')
-rw-r--r-- | core/decoders/tight.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/core/decoders/tight.js b/core/decoders/tight.js index 7695d44..b207419 100644 --- a/core/decoders/tight.js +++ b/core/decoders/tight.js @@ -160,10 +160,9 @@ export default class TightDecoder { return false; } - data = this._zlibs[streamId].inflate(data, true, uncompressedSize); - if (data.length != uncompressedSize) { - throw new Error("Incomplete zlib block"); - } + this._zlibs[streamId].setInput(data); + data = this._zlibs[streamId].inflate(uncompressedSize); + this._zlibs[streamId].setInput(null); } display.blitRgbImage(x, y, width, height, data, 0, false); @@ -208,10 +207,9 @@ export default class TightDecoder { return false; } - data = this._zlibs[streamId].inflate(data, true, uncompressedSize); - if (data.length != uncompressedSize) { - throw new Error("Incomplete zlib block"); - } + this._zlibs[streamId].setInput(data); + data = this._zlibs[streamId].inflate(uncompressedSize); + this._zlibs[streamId].setInput(null); } // Convert indexed (palette based) image data to RGB |