(Adler32): skip checksum update for zero-length arrays.

This commit is contained in:
morkt
2016-09-14 20:08:13 +04:00
parent 3678e02fec
commit 98d0c47cfb
2 changed files with 9 additions and 2 deletions

View File

@@ -179,8 +179,11 @@ namespace GameRes.Compression
public override void Write (byte[] buffer, int offset, int count)
{
m_adler.Write (buffer, offset, count);
m_total_in += count;
if (count > 0)
{
m_adler.Write (buffer, offset, count);
m_total_in += count;
}
}
public override void WriteByte (byte value)