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@users.sourceforge.net>2013-08-03 18:58:26 +0400
committerXhmikosR <xhmikosr@users.sourceforge.net>2013-08-09 13:53:35 +0400
commit2d1d55517fefb983809f684430e7305b5e2e52a2 (patch)
tree598c8f84f933f844c8389f4735e34bc3545e6201 /src/thirdparty/unrar
parent332593479bc5fb7e1313a3267698124fa76282de (diff)
Update Unrar to 5.0.9.
Diffstat (limited to 'src/thirdparty/unrar')
-rw-r--r--src/thirdparty/unrar/blake2s.cpp2
-rw-r--r--src/thirdparty/unrar/blake2s.hpp51
-rw-r--r--src/thirdparty/unrar/blake2sp.cpp20
-rw-r--r--src/thirdparty/unrar/compress.hpp4
-rw-r--r--src/thirdparty/unrar/dll.rc8
-rw-r--r--src/thirdparty/unrar/errhnd.cpp4
-rw-r--r--src/thirdparty/unrar/errhnd.hpp1
-rw-r--r--src/thirdparty/unrar/rar.cpp1
-rw-r--r--src/thirdparty/unrar/strfn.hpp2
-rw-r--r--src/thirdparty/unrar/version.hpp6
10 files changed, 71 insertions, 28 deletions
diff --git a/src/thirdparty/unrar/blake2s.cpp b/src/thirdparty/unrar/blake2s.cpp
index b9804654e..ca3675d57 100644
--- a/src/thirdparty/unrar/blake2s.cpp
+++ b/src/thirdparty/unrar/blake2s.cpp
@@ -57,7 +57,7 @@ static inline void blake2s_increment_counter( blake2s_state *S, const uint32 inc
/* init2 xors IV with input parameter block */
void blake2s_init_param( blake2s_state *S, uint32 node_offset, uint32 node_depth)
{
- S->init(); // Clean and set pointers.
+ S->init(); // Clean data.
for( int i = 0; i < 8; ++i )
S->h[i] = blake2s_IV[i];
diff --git a/src/thirdparty/unrar/blake2s.hpp b/src/thirdparty/unrar/blake2s.hpp
index 66501cc63..7dd715713 100644
--- a/src/thirdparty/unrar/blake2s.hpp
+++ b/src/thirdparty/unrar/blake2s.hpp
@@ -21,7 +21,10 @@ struct blake2s_state
{
enum { BLAKE_ALIGNMENT = 64 };
- byte ubuf[48 + 2 * BLAKE2S_BLOCKBYTES + BLAKE_ALIGNMENT];
+ // buffer and uint32 h[8], t[2], f[2];
+ enum { BLAKE_DATA_SIZE = 48 + 2 * BLAKE2S_BLOCKBYTES };
+
+ byte ubuf[BLAKE_DATA_SIZE + BLAKE_ALIGNMENT];
byte *buf; // byte buf[2 * BLAKE2S_BLOCKBYTES].
uint32 *h, *t, *f; // uint32 h[8], t[2], f[2].
@@ -29,14 +32,47 @@ struct blake2s_state
size_t buflen;
byte last_node;
- void init()
+ blake2s_state()
+ {
+ set_pointers();
+ }
+
+ // Required when we declare and assign in the same command.
+ blake2s_state(blake2s_state &st)
{
- memset( this, 0, sizeof( blake2s_state ) );
+ set_pointers();
+ *this=st;
+ }
+
+ void set_pointers()
+ {
+ // Set aligned pointers. Must be done in constructor, not in Init(),
+ // so assignments like 'blake2sp_state res=blake2ctx' work correctly
+ // even if blake2sp_init is not called for 'res'.
buf = (byte *) ALIGN_VALUE(ubuf, BLAKE_ALIGNMENT);
h = (uint32 *) (buf + 2 * BLAKE2S_BLOCKBYTES);
t = h + 8;
f = t + 2;
}
+
+ void init()
+ {
+ memset( ubuf, 0, sizeof( ubuf ) );
+ buflen = 0;
+ last_node = 0;
+ }
+
+ // Since we use pointers, the default = would work incorrectly.
+ blake2s_state& operator = (blake2s_state &st)
+ {
+ if (this != &st)
+ {
+ memcpy(buf, st.buf, BLAKE_DATA_SIZE);
+ buflen = st.buflen;
+ last_node = st.last_node;
+ }
+ return *this;
+ }
};
@@ -44,10 +80,10 @@ struct blake2s_state
class ThreadPool;
#endif
-typedef struct __blake2sp_state
+struct blake2sp_state
{
- blake2s_state S[8][1];
- blake2s_state R[1];
+ blake2s_state S[8];
+ blake2s_state R;
byte buf[8 * BLAKE2S_BLOCKBYTES];
size_t buflen;
@@ -55,8 +91,7 @@ typedef struct __blake2sp_state
ThreadPool *ThPool;
uint MaxThreads;
#endif
-
-} blake2sp_state;
+};
void blake2sp_init( blake2sp_state *S );
void blake2sp_update( blake2sp_state *S, const byte *in, size_t inlen );
diff --git a/src/thirdparty/unrar/blake2sp.cpp b/src/thirdparty/unrar/blake2sp.cpp
index 730283e45..da645883b 100644
--- a/src/thirdparty/unrar/blake2sp.cpp
+++ b/src/thirdparty/unrar/blake2sp.cpp
@@ -18,13 +18,13 @@ void blake2sp_init( blake2sp_state *S )
memset( S->buf, 0, sizeof( S->buf ) );
S->buflen = 0;
- blake2s_init_param( S->R, 0, 1 ); // Init root.
+ blake2s_init_param( &S->R, 0, 1 ); // Init root.
for( uint i = 0; i < PARALLELISM_DEGREE; ++i )
- blake2s_init_param( S->S[i], i, 0 ); // Init leaf.
+ blake2s_init_param( &S->S[i], i, 0 ); // Init leaf.
- S->R->last_node = 1;
- S->S[PARALLELISM_DEGREE - 1]->last_node = 1;
+ S->R.last_node = 1;
+ S->S[PARALLELISM_DEGREE - 1].last_node = 1;
}
@@ -74,7 +74,7 @@ void blake2sp_update( blake2sp_state *S, const byte *in, size_t inlen )
memcpy( S->buf + left, in, fill );
for( size_t i = 0; i < PARALLELISM_DEGREE; ++i )
- blake2s_update( S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES );
+ blake2s_update( &S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES );
in += fill;
inlen -= fill;
@@ -100,7 +100,7 @@ void blake2sp_update( blake2sp_state *S, const byte *in, size_t inlen )
btd->inlen = inlen;
btd->in = in + id__ * BLAKE2S_BLOCKBYTES;
- btd->S = S->S[id__];
+ btd->S = &S->S[id__];
#ifdef RAR_SMP
if (ThreadNumber>1)
@@ -140,14 +140,14 @@ void blake2sp_final( blake2sp_state *S, byte *digest )
if( left > BLAKE2S_BLOCKBYTES ) left = BLAKE2S_BLOCKBYTES;
- blake2s_update( S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, left );
+ blake2s_update( &S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, left );
}
- blake2s_final( S->S[i], hash[i] );
+ blake2s_final( &S->S[i], hash[i] );
}
for( size_t i = 0; i < PARALLELISM_DEGREE; ++i )
- blake2s_update( S->R, hash[i], BLAKE2S_OUTBYTES );
+ blake2s_update( &S->R, hash[i], BLAKE2S_OUTBYTES );
- blake2s_final( S->R, digest );
+ blake2s_final( &S->R, digest );
}
diff --git a/src/thirdparty/unrar/compress.hpp b/src/thirdparty/unrar/compress.hpp
index edaed3084..fbeaa2d2d 100644
--- a/src/thirdparty/unrar/compress.hpp
+++ b/src/thirdparty/unrar/compress.hpp
@@ -34,8 +34,10 @@ enum {CODE_HUFFMAN,CODE_LZ,CODE_REPEATLZ,CODE_CACHELZ,
enum FilterType {
+ // These values must not be changed, because we use them directly
+ // in RAR5 compression and decompression code.
FILTER_DELTA=0, FILTER_E8, FILTER_E8E9, FILTER_ARM,
- FILTER_AUDIO, FILTER_RGB, FILTER_ITANIUM, FILTER_PPM /*dummy*/, FILTER_NONE
+ FILTER_AUDIO, FILTER_RGB, FILTER_ITANIUM, FILTER_PPM, FILTER_NONE
};
#endif
diff --git a/src/thirdparty/unrar/dll.rc b/src/thirdparty/unrar/dll.rc
index ee08b5e3b..cc229a2b2 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, 0, 7, 925
-PRODUCTVERSION 5, 0, 7, 925
+FILEVERSION 5, 0, 8, 945
+PRODUCTVERSION 5, 0, 8, 945
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
{
@@ -14,8 +14,8 @@ FILETYPE VFT_APP
VALUE "CompanyName", "Alexander Roshal\0"
VALUE "ProductName", "RAR decompression library\0"
VALUE "FileDescription", "RAR decompression library\0"
- VALUE "FileVersion", "5.0.7\0"
- VALUE "ProductVersion", "5.0.7\0"
+ VALUE "FileVersion", "5.0.8\0"
+ VALUE "ProductVersion", "5.0.8\0"
VALUE "LegalCopyright", "Copyright © Alexander Roshal 1993-2013\0"
VALUE "OriginalFilename", "Unrar.dll\0"
}
diff --git a/src/thirdparty/unrar/errhnd.cpp b/src/thirdparty/unrar/errhnd.cpp
index 1fb40c7b8..a47d1c16c 100644
--- a/src/thirdparty/unrar/errhnd.cpp
+++ b/src/thirdparty/unrar/errhnd.cpp
@@ -15,6 +15,7 @@ void ErrorHandler::Clean()
Silent=false;
DoShutdown=false;
UserBreak=false;
+ MainExit=false;
}
@@ -287,7 +288,8 @@ void _stdfunction ProcessSignal(int SigType)
#ifdef _WIN_ALL
// Let the main thread to handle 'throw' and destroy file objects.
- Sleep(200);
+ for (uint I=0;!ErrHandler.MainExit && I<50;I++)
+ Sleep(100);
#if defined(USE_RC) && !defined(SFX_MODULE) && !defined(RARDLL)
ExtRes.UnloadDLL();
#endif
diff --git a/src/thirdparty/unrar/errhnd.hpp b/src/thirdparty/unrar/errhnd.hpp
index 2edfb316b..cf64cc1b4 100644
--- a/src/thirdparty/unrar/errhnd.hpp
+++ b/src/thirdparty/unrar/errhnd.hpp
@@ -60,6 +60,7 @@ class ErrorHandler
int GetSystemErrorCode();
void SetSystemErrorCode(int Code);
bool UserBreak;
+ bool MainExit; // main() is completed.
};
diff --git a/src/thirdparty/unrar/rar.cpp b/src/thirdparty/unrar/rar.cpp
index 02340e157..089616ce9 100644
--- a/src/thirdparty/unrar/rar.cpp
+++ b/src/thirdparty/unrar/rar.cpp
@@ -96,6 +96,7 @@ int main(int argc, char *argv[])
if (ShutdownOnClose)
Shutdown();
#endif
+ ErrHandler.MainExit=true;
return ErrHandler.GetErrorCode();
}
#endif
diff --git a/src/thirdparty/unrar/strfn.hpp b/src/thirdparty/unrar/strfn.hpp
index 56e076de8..fae2c93a6 100644
--- a/src/thirdparty/unrar/strfn.hpp
+++ b/src/thirdparty/unrar/strfn.hpp
@@ -38,7 +38,9 @@ void itoa(int64 n,char *Str);
void itoa(int64 n,wchar *Str);
const wchar* GetWide(const char *Src);
const wchar* GetCmdParam(const wchar *CmdLine,wchar *Param,size_t MaxSize);
+#ifndef SILENT
void PrintfPrepareFmt(const wchar *Org,wchar *Cvt,size_t MaxSize);
+#endif
enum PASSWORD_TYPE {PASSWORD_GLOBAL,PASSWORD_FILE,PASSWORD_ARCHIVE};
bool GetPassword(PASSWORD_TYPE Type,const wchar *FileName,SecPassword *Password);
diff --git a/src/thirdparty/unrar/version.hpp b/src/thirdparty/unrar/version.hpp
index d2a226274..50f490638 100644
--- a/src/thirdparty/unrar/version.hpp
+++ b/src/thirdparty/unrar/version.hpp
@@ -1,6 +1,6 @@
#define RARVER_MAJOR 5
#define RARVER_MINOR 0
-#define RARVER_BETA 7
-#define RARVER_DAY 13
-#define RARVER_MONTH 7
+#define RARVER_BETA 8
+#define RARVER_DAY 2
+#define RARVER_MONTH 8
#define RARVER_YEAR 2013