Skip to content

Commit 38cba35

Browse files
Ruben J. Garcia-HernandezNicodemos234
Ruben J. Garcia-Hernandez
authored andcommitted
Fix 32-bit limitation showcased at
Stuk#777 which causes Bug : uncompressed data size mismatch
1 parent 2ceb998 commit 38cba35

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

dist/jszip.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1856,7 +1856,7 @@ DataReader.prototype = {
18561856
i;
18571857
this.checkOffset(size);
18581858
for (i = this.index + size - 1; i >= this.index; i--) {
1859-
result = (result << 8) + this.byteAt(i);
1859+
result = (result * 256) + this.byteAt(i);
18601860
}
18611861
this.index += size;
18621862
return result;
@@ -11574,4 +11574,4 @@ module.exports = ZStream;
1157411574

1157511575
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
1157611576
},{}]},{},[10])(10)
11577-
});
11577+
});

lib/reader/DataReader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ DataReader.prototype = {
6161
i;
6262
this.checkOffset(size);
6363
for (i = this.index + size - 1; i >= this.index; i--) {
64-
result = (result << 8) + this.byteAt(i);
64+
result = (result * 256) + this.byteAt(i);
6565
}
6666
this.index += size;
6767
return result;

0 commit comments

Comments
 (0)