Open JMS-1 opened 2 years ago
Problem is that << only reproduces 32 Bit Value, so
readInt: function(size) {
var result = 0,
i;
this.checkOffset(size);
for (i = this.index + size - 1; i >= this.index; i--) {
result = (result << 8) + this.byteAt(i);
}
this.index += size;
return result;
},
will mess with the sign if the MSB is larger than 127. Better use multiplication
readInt: function(size) {
var result = 0,
i;
this.checkOffset(size);
for (i = this.index + size - 1; i >= this.index; i--) {
result = (result * 256) + this.byteAt(i);
}
this.index += size;
return result;
},
_FYI: * 256 will be safe up to 53 Bit (MAX_SAFEINTEGER) which is around 9 PetaByte.
We are also affected.
I got a ZIP which includes a single file with more than 2GB in (decompressed) size. On decompression the error from the title is thrown. It clearly is some 32Bit signed/unsigned issue:
So my question is: is there a size limit of 2GB for individual files inside the ZIP (which by the way has been created with jszip 3.7.1 as well)?
Thanks
Jochen