LZMA_IO_ERROR was returned instead of LZMA_THREAD_ERROR

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3879 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2005-01-18 18:06:09 +00:00
parent 6de9916400
commit 8557bafca2

View file

@ -221,13 +221,15 @@ int CLZMA::CompressReal()
try try
{ {
HRESULT hResult = _encoder->WriteCoderProperties(this); HRESULT hResult = _encoder->WriteCoderProperties(this);
if (res == S_OK) if (hResult == S_OK)
{ {
while (true) while (true)
{ {
UINT64 inSize, outSize; UINT64 inSize, outSize;
INT32 finished; INT32 finished;
res = ConvertError(_encoder->CodeOneBlock(&inSize, &outSize, &finished)); hResult = _encoder->CodeOneBlock(&inSize, &outSize, &finished);
if (hResult != S_OK && res == C_OK)
res = ConvertError(hResult);
if (res != C_OK) if (res != C_OK)
break; break;
if (finished) if (finished)
@ -239,12 +241,14 @@ int CLZMA::CompressReal()
} }
else else
{ {
res = ConvertError(hResult); if (res == C_OK)
res = ConvertError(hResult);
} }
} }
catch (...) catch (...)
{ {
res = LZMA_IO_ERROR; if (res == C_OK)
res = LZMA_IO_ERROR;
} }
compressor_finished = TRUE; compressor_finished = TRUE;