diff --git a/deps/unrar/hc_decompress_rar.cpp b/deps/unrar/hc_decompress_rar.cpp index 7266c0877..36b91a172 100644 --- a/deps/unrar/hc_decompress_rar.cpp +++ b/deps/unrar/hc_decompress_rar.cpp @@ -47,6 +47,10 @@ extern "C" unsigned int hc_decompress_rar (unsigned char *Win, unsigned char *In Unp.DoUnpack (METHOD, SOLID); // sets output + unsigned int wfs = (unsigned int) Unp.GetWrittenFileSize(); + + if (wfs != UnpackSize) return 0; + unsigned int crc32 = (unsigned int) DataIO.UnpHash.GetCRC32 (); return crc32; diff --git a/deps/unrar/unpack.hpp b/deps/unrar/unpack.hpp index 3e23cd320..ab6531f09 100644 --- a/deps/unrar/unpack.hpp +++ b/deps/unrar/unpack.hpp @@ -383,6 +383,7 @@ class Unpack:PackDef bool IsFileExtracted() {return(FileExtracted);} void SetDestSize(int64 DestSize) {DestUnpSize=DestSize;FileExtracted=false;} void SetSuspended(bool Suspended) {Unpack::Suspended=Suspended;} + int64 GetWrittenFileSize() {return(WrittenFileSize);} #ifdef RAR_SMP void SetThreads(uint Threads); diff --git a/docs/changes.txt b/docs/changes.txt index 283e3c0d4..4b110c23c 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -129,6 +129,7 @@ - Metal Backend: added workaround to prevent 'Infinite Loop' bug when build kernels - Metal Backend: allow use of devices with Metal if runtime version is >= 200 - Metal Backend: disable Metal devices only if at least one OpenCL device is active +- Modules: Check UnpackSize to raise false positive with hc_decompress_rar - User Options: added --metal-compiler-runtime option - Hardware Monitor: avoid sprintf in src/ext_iokit.c - Help: show supported hash-modes only with -hh