diff options
author | Anssi Hannula <anssi@xbmc.org> | 2012-05-16 17:13:07 +0300 |
---|---|---|
committer | Anssi Hannula <anssi@xbmc.org> | 2012-05-16 19:30:21 +0300 |
commit | 683457d27736c09415a11d80933553f75139a253 (patch) | |
tree | e126a2bbfb65182b8e73eec9b1d5781669481c3d /lib/UnrarXLib | |
parent | 840cd4ce4ac8c781e7d35db2ed86d575a42c37e7 (diff) |
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.
Diffstat (limited to 'lib/UnrarXLib')
-rw-r--r-- | lib/UnrarXLib/volume.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/UnrarXLib/volume.cpp b/lib/UnrarXLib/volume.cpp index 1f4d5e3ffb..b24e98bd61 100644 --- a/lib/UnrarXLib/volume.cpp +++ b/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) |