Skip to content
Browse files

fixed: rars that have unpacked size stored on first volume only

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...
1 parent 840cd4c commit 683457d27736c09415a11d80933553f75139a253 @anssih anssih committed May 16, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/UnrarXLib/volume.cpp
View
8 lib/UnrarXLib/volume.cpp
@@ -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();
@@ -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)

0 comments on commit 683457d

Please sign in to comment.
Something went wrong with that request. Please try again.