Handle errors from zlib/pako
This commit is contained in:
parent
f6669ff7b2
commit
3cf11004b4
|
@ -35,7 +35,10 @@ export default class Inflate {
|
||||||
|
|
||||||
this.strm.avail_out = this.chunkSize;
|
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) {
|
if (this.strm.next_out != expected) {
|
||||||
throw new Error("Incomplete zlib block");
|
throw new Error("Incomplete zlib block");
|
||||||
|
|
Loading…
Reference in New Issue