add comment and change the same code in new Unpack50

This commit is contained in:
Morilli
2025-02-11 11:03:56 +01:00
parent 04b25011e9
commit a77c03fcaf
2 changed files with 5 additions and 1 deletions

View File

@@ -713,6 +713,8 @@ internal sealed partial class Unpack : BitInput, IRarUnpack, IDisposable
private void UnpWriteData(byte[] data, int offset, int size)
{
// allow destUnpSize == 0 here to ensure that 0 size writes
// go through RarStream's Write so that Suspended is set correctly
if (destUnpSize < 0)
{
return;

View File

@@ -655,7 +655,9 @@ internal partial class Unpack
private void UnpWriteData(byte[] Data, size_t offset, size_t Size)
{
if (WrittenFileSize >= DestUnpSize)
// allow WrittenFileSize == DestUnpSize here to ensure that 0 size writes
// go through RarStream's Write so that Suspended is set correctly
if (WrittenFileSize > DestUnpSize)
{
return;
}