Fix bug 15520. The EPPlus Call to Method 'new ExcelPackage(rawStream)' Returns 'STG_E_WRITEFAULT' When It Attempts to Read a Valid .xlsx File. This change was originally made on 08/22/2016 but it was lost when we added EPPlus to GitHub.
diff --git a/EPPlus/Packaging/DotNetZip/ZipEntry.Read.cs b/EPPlus/Packaging/DotNetZip/ZipEntry.Read.cs index 7e11e5a..46a69eb 100644 --- a/EPPlus/Packaging/DotNetZip/ZipEntry.Read.cs +++ b/EPPlus/Packaging/DotNetZip/ZipEntry.Read.cs
@@ -217,7 +217,7 @@ ze._UncompressedSize = BitConverter.ToInt64(block, i); i += 8; - ze._LengthOfTrailer += 24; // bytes including sig, CRC, Comp and Uncomp sizes + ze._LengthOfTrailer = 24; // bytes including sig, CRC, Comp and Uncomp sizes } else { @@ -235,7 +235,7 @@ ze._CompressedSize = (uint)(block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256); ze._UncompressedSize = (uint)(block[i++] + block[i++] * 256 + block[i++] * 256 * 256 + block[i++] * 256 * 256 * 256); - ze._LengthOfTrailer += 16; // bytes including sig, CRC, Comp and Uncomp sizes + ze._LengthOfTrailer = 16; // bytes including sig, CRC, Comp and Uncomp sizes }