]> git.proxmox.com Git - mirror_novnc.git/blobdiff - core/inflator.js
Handle errors from zlib/pako
[mirror_novnc.git] / core / inflator.js
index 726600f98af710c89dad2ccab4529d9aee4ca324..39db447a10250c9e8d3edbd9a20279a0e1f77bda 100644 (file)
@@ -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");