mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-13 00:11:34 -06:00
Add error check
This commit is contained in:
@@ -121,6 +121,10 @@ STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream, ISequentialOutStream
|
|||||||
return SResToHRESULT(res);
|
return SResToHRESULT(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Fast LZMA2 encoder
|
||||||
|
|
||||||
|
|
||||||
static HRESULT TranslateError(size_t res)
|
static HRESULT TranslateError(size_t res)
|
||||||
{
|
{
|
||||||
if (FL2_getErrorCode(res) == FL2_error_memory_allocation)
|
if (FL2_getErrorCode(res) == FL2_error_memory_allocation)
|
||||||
@@ -298,7 +302,7 @@ HRESULT CFastEncoder::FastLzma2::End(ISequentialOutStream *outStream, ICompressP
|
|||||||
size_t res = FL2_endStream(fcs, nullptr);
|
size_t res = FL2_endStream(fcs, nullptr);
|
||||||
CHECK_H(WaitAndReport(res, progress));
|
CHECK_H(WaitAndReport(res, progress));
|
||||||
while (res) {
|
while (res) {
|
||||||
WriteBuffers(outStream);
|
CHECK_H(WriteBuffers(outStream));
|
||||||
res = FL2_endStream(fcs, nullptr);
|
res = FL2_endStream(fcs, nullptr);
|
||||||
CHECK_H(WaitAndReport(res, progress));
|
CHECK_H(WaitAndReport(res, progress));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user