mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-10 20:07:05 -06:00
15.09
This commit is contained in:
committed by
Kornel Lesiński
parent
6543c28020
commit
a663a6deb7
@@ -513,10 +513,11 @@ static int main2(int numArgs, const char *args[])
|
||||
if (parser[NKey::kEOS].ThereIs || stdInMode)
|
||||
throw "Can not use stdin in this mode";
|
||||
|
||||
if (fileSize > 0xF0000000)
|
||||
throw "File is too big";
|
||||
|
||||
size_t inSize = (size_t)fileSize;
|
||||
|
||||
if (inSize != fileSize)
|
||||
throw "File is too big";
|
||||
|
||||
Byte *inBuffer = NULL;
|
||||
|
||||
if (inSize != 0)
|
||||
@@ -535,7 +536,13 @@ static int main2(int numArgs, const char *args[])
|
||||
if (encodeMode)
|
||||
{
|
||||
// we allocate 105% of original size for output buffer
|
||||
outSize = (size_t)fileSize / 20 * 21 + (1 << 16);
|
||||
UInt64 outSize64 = fileSize / 20 * 21 + (1 << 16);
|
||||
|
||||
outSize = (size_t)outSize64;
|
||||
|
||||
if (outSize != outSize64)
|
||||
throw "File is too big";
|
||||
|
||||
if (outSize != 0)
|
||||
{
|
||||
outBuffer = (Byte *)MyAlloc((size_t)outSize);
|
||||
@@ -561,7 +568,7 @@ static int main2(int numArgs, const char *args[])
|
||||
|
||||
outSize = (size_t)outSize64;
|
||||
if (outSize != outSize64)
|
||||
throw "too big";
|
||||
throw "Unpack size is too big";
|
||||
if (outSize != 0)
|
||||
{
|
||||
outBuffer = (Byte *)MyAlloc(outSize);
|
||||
|
||||
Reference in New Issue
Block a user