From 683457d27736c09415a11d80933553f75139a253 Mon Sep 17 00:00:00 2001 From: Anssi Hannula Date: Wed, 16 May 2012 17:13:07 +0300 Subject: [PATCH] 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. --- lib/UnrarXLib/volume.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/UnrarXLib/volume.cpp b/lib/UnrarXLib/volume.cpp index 1f4d5e3ffb1b7..b24e98bd614fd 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)