Skip to content

Commit

Permalink
Handle errors from zlib/pako
Browse files Browse the repository at this point in the history
  • Loading branch information
CendioNiko committed Feb 17, 2020
1 parent f6669ff commit 3cf1100
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/inflator.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ export default class Inflate {

this.strm.avail_out = this.chunkSize;

inflate(this.strm, 0); // Flush argument not used.
let ret = inflate(this.strm, 0); // Flush argument not used.
if (ret < 0) {
throw new Error("zlib inflate failed");
}

if (this.strm.next_out != expected) {
throw new Error("Incomplete zlib block");
Expand Down

0 comments on commit 3cf1100

Please sign in to comment.