bugfix: eliminate spurious rar crc exception when Read() is called with count = 0 (#313)

This commit is contained in:
coderb
2017-10-23 06:58:02 -04:00
committed by Adam Hathcock
parent 50b01428b4
commit 550fecd4d3

View File

@@ -31,7 +31,7 @@ namespace SharpCompress.Compressors.Rar {
{
currentCrc = RarCRC.CheckCrc(currentCrc, buffer, offset, result);
}
else if (GetCrc() != readStream.CurrentCrc)
else if (GetCrc() != readStream.CurrentCrc && count != 0)
{
// NOTE: we use the last FileHeader in a multipart volume to check CRC
throw new InvalidFormatException("file crc mismatch");