Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/SharpCompress/Compressors/Rar/UnpackV1/Unpack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ private void Unpack29(bool solid)
if (((wrPtr - unpPtr) & PackDef.MAXWINMASK) < 260 && wrPtr != unpPtr)
{
UnpWriteBuf();
if (destUnpSize <= 0)
if (destUnpSize < 0)
{
return;
}
Expand Down Expand Up @@ -713,7 +713,9 @@ private void UnpWriteArea(int startPtr, int endPtr)

private void UnpWriteData(byte[] data, int offset, int size)
{
if (destUnpSize <= 0)
// 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;
}
Expand Down