Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/thirdparty/unrar/archive.cpp')
-rw-r--r--src/thirdparty/unrar/archive.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/thirdparty/unrar/archive.cpp b/src/thirdparty/unrar/archive.cpp
index 7ca0b7461..203899fef 100644
--- a/src/thirdparty/unrar/archive.cpp
+++ b/src/thirdparty/unrar/archive.cpp
@@ -109,9 +109,9 @@ RARFORMAT Archive::IsSignature(const byte *D,size_t Size)
#endif
if (Size>=7 && D[1]==0x61 && D[2]==0x72 && D[3]==0x21 && D[4]==0x1a && D[5]==0x07)
{
- // We check for non-zero last signature byte, so we can return
- // a sensible warning in case we'll want to change the archive
- // format sometimes in the future.
+ // We check the last signature byte, so we can return a sensible
+ // warning in case we'll want to change the archive format
+ // sometimes in the future.
if (D[6]==0)
Type=RARFMT15;
else
@@ -240,13 +240,22 @@ bool Archive::IsArchive(bool EnableBroken)
{
HEADER_TYPE HeaderType=GetHeaderType();
if (HeaderType==HEAD_SERVICE)
+ {
+ // If we have a split service headers, it surely indicates non-first
+ // volume. But not split service header does not guarantee the first
+ // volume, because we can have split file after non-split archive
+ // comment. So we do not quit from loop here.
FirstVolume=Volume && !SubHead.SplitBefore;
+ }
else
if (HeaderType==HEAD_FILE)
{
FirstVolume=Volume && !FileHead.SplitBefore;
break;
}
+ else
+ if (HeaderType==HEAD_ENDARC) // Might happen if archive contains only a split service header.
+ break;
SeekToNext();
}
CurBlockPos=SaveCurBlockPos;