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:
authorXhmikosR <xhmikosr@gmail.com>2015-01-25 19:41:39 +0300
committerXhmikosR <xhmikosr@gmail.com>2015-01-25 19:48:03 +0300
commit578b26ead1793ff64e09c5b8be9ca49bfa219843 (patch)
treeca83ba6bd59829e0d372f141ef5935756f79ab2a /src/thirdparty/unrar
parent3945b09f12a13c5294f2bf7fee198d5a90985e18 (diff)
Update unrar to v5.2.4.
Conflicts: docs/Changelog.txt
Diffstat (limited to 'src/thirdparty/unrar')
-rw-r--r--src/thirdparty/unrar/archive.cpp2
-rw-r--r--src/thirdparty/unrar/archive.hpp4
-rw-r--r--src/thirdparty/unrar/arcread.cpp14
-rw-r--r--src/thirdparty/unrar/dll.rc10
-rw-r--r--src/thirdparty/unrar/extract.cpp2
-rw-r--r--src/thirdparty/unrar/filcreat.cpp1
-rw-r--r--src/thirdparty/unrar/os.hpp2
-rw-r--r--src/thirdparty/unrar/uicommon.cpp7
-rw-r--r--src/thirdparty/unrar/unpack50.cpp8
-rw-r--r--src/thirdparty/unrar/unpack50mt.cpp10
-rw-r--r--src/thirdparty/unrar/version.hpp10
11 files changed, 42 insertions, 28 deletions
diff --git a/src/thirdparty/unrar/archive.cpp b/src/thirdparty/unrar/archive.cpp
index 9e9e72424..7ca0b7461 100644
--- a/src/thirdparty/unrar/archive.cpp
+++ b/src/thirdparty/unrar/archive.cpp
@@ -234,6 +234,7 @@ bool Archive::IsArchive(bool EnableBroken)
{
SaveFilePos SavePos(*this);
int64 SaveCurBlockPos=CurBlockPos,SaveNextBlockPos=NextBlockPos;
+ HEADER_TYPE SaveCurHeaderType=CurHeaderType;
while (ReadHeader()!=0)
{
@@ -250,6 +251,7 @@ bool Archive::IsArchive(bool EnableBroken)
}
CurBlockPos=SaveCurBlockPos;
NextBlockPos=SaveNextBlockPos;
+ CurHeaderType=SaveCurHeaderType;
}
if (!Volume || FirstVolume)
wcscpy(FirstVolumeName,FileName);
diff --git a/src/thirdparty/unrar/archive.hpp b/src/thirdparty/unrar/archive.hpp
index 1d8444bfb..522709608 100644
--- a/src/thirdparty/unrar/archive.hpp
+++ b/src/thirdparty/unrar/archive.hpp
@@ -85,8 +85,8 @@ class Archive:public File
void AddSubData(byte *SrcData,uint64 DataSize,File *SrcFile,
const wchar *Name,uint Flags);
bool ReadSubData(Array<byte> *UnpData,File *DestFile);
- HEADER_TYPE GetHeaderType() {return(CurHeaderType);};
- RAROptions* GetRAROptions() {return(Cmd);}
+ HEADER_TYPE GetHeaderType() {return CurHeaderType;};
+ RAROptions* GetRAROptions() {return Cmd;}
void SetSilentOpen(bool Mode) {SilentOpen=Mode;}
#ifdef USE_QOPEN
bool Open(const wchar *Name,uint Mode=FMF_READ);
diff --git a/src/thirdparty/unrar/arcread.cpp b/src/thirdparty/unrar/arcread.cpp
index e4c3f87d5..e8e5991da 100644
--- a/src/thirdparty/unrar/arcread.cpp
+++ b/src/thirdparty/unrar/arcread.cpp
@@ -44,10 +44,10 @@ size_t Archive::SearchBlock(HEADER_TYPE HeaderType)
if ((++Count & 127)==0)
Wait();
if (GetHeaderType()==HeaderType)
- return(Size);
+ return Size;
SeekToNext();
}
- return(0);
+ return 0;
}
@@ -128,7 +128,7 @@ size_t Archive::ReadHeader15()
if (Read(Salt,SIZE_SALT30)!=SIZE_SALT30)
{
UnexpEndArcMsg();
- return(0);
+ return 0;
}
HeadersCrypt.SetCryptKeys(false,CRYPT_RAR30,&Cmd->Password,Salt,NULL,0,NULL,NULL);
Raw.SetCrypt(&HeadersCrypt);
@@ -155,7 +155,7 @@ size_t Archive::ReadHeader15()
if (ShortBlock.HeadSize<SIZEOF_SHORTBLOCKHEAD)
{
BrokenHeaderMsg();
- return(0);
+ return 0;
}
// For simpler further processing we map header types common
@@ -562,7 +562,7 @@ size_t Archive::ReadHeader50()
if (Decrypt)
{
#if defined(SHELL_EXT) || defined(RAR_NOCRYPT)
- return(0);
+ return 0;
#else
RequestArcPassword();
@@ -570,7 +570,7 @@ size_t Archive::ReadHeader50()
if (Read(HeadersInitV,SIZE_INITV)!=SIZE_INITV)
{
UnexpEndArcMsg();
- return(0);
+ return 0;
}
byte PswCheck[SIZE_PSWCHECK];
@@ -1168,7 +1168,7 @@ size_t Archive::ReadHeader14()
NextBlockPos=CurBlockPos+FileHead.HeadSize+FileHead.PackSize;
CurHeaderType=HEAD_FILE;
}
- return(NextBlockPos>CurBlockPos ? Raw.Size():0);
+ return NextBlockPos>CurBlockPos ? Raw.Size() : 0;
}
#endif
diff --git a/src/thirdparty/unrar/dll.rc b/src/thirdparty/unrar/dll.rc
index 1481d7632..3c90c69cb 100644
--- a/src/thirdparty/unrar/dll.rc
+++ b/src/thirdparty/unrar/dll.rc
@@ -2,8 +2,8 @@
#include <commctrl.h>
VS_VERSION_INFO VERSIONINFO
-FILEVERSION 5, 20, 100, 1433
-PRODUCTVERSION 5, 20, 100, 1433
+FILEVERSION 5, 21, 1, 1472
+PRODUCTVERSION 5, 21, 1, 1472
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
{
@@ -14,9 +14,9 @@ FILETYPE VFT_APP
VALUE "CompanyName", "Alexander Roshal\0"
VALUE "ProductName", "RAR decompression library\0"
VALUE "FileDescription", "RAR decompression library\0"
- VALUE "FileVersion", "5.20.0\0"
- VALUE "ProductVersion", "5.20.0\0"
- VALUE "LegalCopyright", "Copyright © Alexander Roshal 1993-2014\0"
+ VALUE "FileVersion", "5.21.1\0"
+ VALUE "ProductVersion", "5.21.1\0"
+ VALUE "LegalCopyright", "Copyright © Alexander Roshal 1993-2015\0"
VALUE "OriginalFilename", "Unrar.dll\0"
}
}
diff --git a/src/thirdparty/unrar/extract.cpp b/src/thirdparty/unrar/extract.cpp
index cab669fe9..fb5a39d5b 100644
--- a/src/thirdparty/unrar/extract.cpp
+++ b/src/thirdparty/unrar/extract.cpp
@@ -213,6 +213,8 @@ bool CmdExtract::ExtractCurrentFile(Archive &Arc,size_t HeaderSize,bool &Repeat)
#ifdef NOVOLUME
return false;
#else
+ // Supposing we unpack an old RAR volume without end of archive record
+ // and last file is not split between volumes.
if (!MergeArchive(Arc,&DataIO,false,Command))
{
ErrHandler.SetErrorCode(RARX_WARNING);
diff --git a/src/thirdparty/unrar/filcreat.cpp b/src/thirdparty/unrar/filcreat.cpp
index 8b20b3fa9..6717eee90 100644
--- a/src/thirdparty/unrar/filcreat.cpp
+++ b/src/thirdparty/unrar/filcreat.cpp
@@ -45,7 +45,6 @@ bool FileCreate(RAROptions *Cmd,File *NewFile,wchar *Name,size_t MaxNameSize,
uint FileMode=WriteOnly ? FMF_WRITE|FMF_SHAREREAD:FMF_UPDATE|FMF_SHAREREAD;
if (NewFile!=NULL && NewFile->Create(Name,FileMode))
return true;
- PrepareToDelete(Name);
CreatePath(Name,true);
return NewFile!=NULL ? NewFile->Create(Name,FileMode):DelFile(Name);
}
diff --git a/src/thirdparty/unrar/os.hpp b/src/thirdparty/unrar/os.hpp
index 84f8fc92a..1b0813f6c 100644
--- a/src/thirdparty/unrar/os.hpp
+++ b/src/thirdparty/unrar/os.hpp
@@ -79,6 +79,7 @@
#include <time.h>
#include <signal.h>
+
#define SAVE_LINKS
#define ENABLE_ACCESS
@@ -154,6 +155,7 @@
#include <utime.h>
#include <locale.h>
+
#ifdef S_IFLNK
#define SAVE_LINKS
#endif
diff --git a/src/thirdparty/unrar/uicommon.cpp b/src/thirdparty/unrar/uicommon.cpp
index 7238c1936..5be551a42 100644
--- a/src/thirdparty/unrar/uicommon.cpp
+++ b/src/thirdparty/unrar/uicommon.cpp
@@ -22,11 +22,18 @@ UIASKREP_RESULT uiAskReplaceEx(RAROptions *Cmd,wchar *Name,size_t MaxNameSize,in
// This check must be after OVERWRITE_AUTORENAME processing or -y switch
// would override -or.
if (Cmd->AllYes || Cmd->Overwrite==OVERWRITE_ALL)
+ {
+ PrepareToDelete(Name);
return UIASKREP_R_REPLACE;
+ }
wchar NewName[NM];
wcsncpyz(NewName,Name,ASIZE(NewName));
UIASKREP_RESULT Choice=uiAskReplace(NewName,ASIZE(NewName),FileSize,FileTime,Flags);
+
+ if (Choice==UIASKREP_R_REPLACE || Choice==UIASKREP_R_REPLACEALL)
+ PrepareToDelete(Name);
+
if (Choice==UIASKREP_R_REPLACEALL)
{
Cmd->Overwrite=OVERWRITE_ALL;
diff --git a/src/thirdparty/unrar/unpack50.cpp b/src/thirdparty/unrar/unpack50.cpp
index d1188ee85..7821a3e6b 100644
--- a/src/thirdparty/unrar/unpack50.cpp
+++ b/src/thirdparty/unrar/unpack50.cpp
@@ -570,7 +570,7 @@ bool Unpack::ReadTables(BitInput &Inp,UnpackBlockHeader &Header,UnpackBlockTable
else
{
ZeroCount+=2;
- while (ZeroCount-- > 0 && I<sizeof(BitLength)/sizeof(BitLength[0]))
+ while (ZeroCount-- > 0 && I<ASIZE(BitLength))
BitLength[I++]=0;
I--;
}
@@ -587,7 +587,7 @@ bool Unpack::ReadTables(BitInput &Inp,UnpackBlockHeader &Header,UnpackBlockTable
{
if (!Inp.ExternalBuffer && Inp.InAddr>ReadTop-5)
if (!UnpReadBuf())
- return(false);
+ return false;
int Number=DecodeNumber(Inp,&Tables.BD);
if (Number<16)
{
@@ -633,12 +633,12 @@ bool Unpack::ReadTables(BitInput &Inp,UnpackBlockHeader &Header,UnpackBlockTable
}
}
if (!Inp.ExternalBuffer && Inp.InAddr>ReadTop)
- return(false);
+ return false;
MakeDecodeTables(&Table[0],&Tables.LD,NC);
MakeDecodeTables(&Table[NC],&Tables.DD,DC);
MakeDecodeTables(&Table[NC+DC],&Tables.LDD,LDC);
MakeDecodeTables(&Table[NC+DC+LDC],&Tables.RD,RC);
- return(true);
+ return true;
}
diff --git a/src/thirdparty/unrar/unpack50mt.cpp b/src/thirdparty/unrar/unpack50mt.cpp
index 6015379cc..a013b27e6 100644
--- a/src/thirdparty/unrar/unpack50mt.cpp
+++ b/src/thirdparty/unrar/unpack50mt.cpp
@@ -80,20 +80,22 @@ void Unpack::Unpack5MT(bool Solid)
bool Done=false;
while (!Done)
{
+ // Data amount, which is guaranteed to fit block header and tables,
+ // so we can safely read them without additional checks.
+ const int TooSmallToProcess=1024;
+
int ReadSize=UnpIO->UnpRead(ReadBufMT+DataSize,(UNP_READ_SIZE_MT-DataSize)&~0xf);
if (ReadSize<0)
break;
DataSize+=ReadSize;
if (DataSize==0)
break;
+ if (ReadSize>0 && DataSize<TooSmallToProcess)
+ continue;
bool BufferProcessed=false;
while (BlockStart<DataSize && !Done)
{
- // Data amount, which is guaranteed to fit block header and tables,
- // so we can safely read them without additional checks.
- const int TooSmallToProcess=1024;
-
uint BlockNumber=0,BlockNumberMT=0;
while (BlockNumber<MaxUserThreads*UNP_BLOCKS_PER_THREAD)
{
diff --git a/src/thirdparty/unrar/version.hpp b/src/thirdparty/unrar/version.hpp
index 3a36f22b3..b2844b691 100644
--- a/src/thirdparty/unrar/version.hpp
+++ b/src/thirdparty/unrar/version.hpp
@@ -1,6 +1,6 @@
#define RARVER_MAJOR 5
-#define RARVER_MINOR 20
-#define RARVER_BETA 0
-#define RARVER_DAY 2
-#define RARVER_MONTH 12
-#define RARVER_YEAR 2014
+#define RARVER_MINOR 21
+#define RARVER_BETA 1
+#define RARVER_DAY 9
+#define RARVER_MONTH 1
+#define RARVER_YEAR 2015