Skip to content

Commit

Permalink
fixed: rars that have unpacked size stored on first volume only
Browse files Browse the repository at this point in the history
Some multi-volume RAR files have their unpacked size set as 0 in all
volumes except the first one.

Use the previous unpacked size instead of 0 in such cases in order to
support such files properly.
  • Loading branch information
anssih committed May 16, 2012
1 parent 840cd4c commit 683457d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/UnrarXLib/volume.cpp
Expand Up @@ -15,6 +15,7 @@ bool MergeArchive(Archive &Arc,ComprDataIO *DataIO,bool ShowFileName,char Comman
Log(Arc.FileName,St(MDataBadCRC),hd->FileName,Arc.FileName);
}

Int64 PrevFullUnpSize = hd->FullUnpSize;
Int64 PosBeforeClose=Arc.Tell();
Arc.Close();

Expand Down Expand Up @@ -144,6 +145,13 @@ bool MergeArchive(Archive &Arc,ComprDataIO *DataIO,bool ShowFileName,char Comman
}
}
#endif

if (hd->FullUnpSize == 0)
{
// some archives only have correct UnpSize in the first volume
hd->FullUnpSize = PrevFullUnpSize;
}

if (DataIO!=NULL)
{
if (HeaderType==ENDARC_HEAD)
Expand Down

0 comments on commit 683457d

Please sign in to comment.