From 550fecd4d3a8d31e9daa9af2c6425e05abf63e73 Mon Sep 17 00:00:00 2001 From: coderb Date: Mon, 23 Oct 2017 06:58:02 -0400 Subject: [PATCH] bugfix: eliminate spurious rar crc exception when Read() is called with count = 0 (#313) --- src/SharpCompress/Compressors/Rar/RarCrcStream.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SharpCompress/Compressors/Rar/RarCrcStream.cs b/src/SharpCompress/Compressors/Rar/RarCrcStream.cs index 3760d252..3a46cd77 100644 --- a/src/SharpCompress/Compressors/Rar/RarCrcStream.cs +++ b/src/SharpCompress/Compressors/Rar/RarCrcStream.cs @@ -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");