Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/7zip/Archive/XzHandler.cpp')
-rw-r--r--CPP/7zip/Archive/XzHandler.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/CPP/7zip/Archive/XzHandler.cpp b/CPP/7zip/Archive/XzHandler.cpp
index ada14fbf..11f4b444 100644
--- a/CPP/7zip/Archive/XzHandler.cpp
+++ b/CPP/7zip/Archive/XzHandler.cpp
@@ -351,7 +351,8 @@ struct COpenCallbackWrap
static SRes OpenCallbackProgress(void *pp, UInt64 inSize, UInt64 /* outSize */)
{
COpenCallbackWrap *p = (COpenCallbackWrap *)pp;
- p->Res = p->OpenCallback->SetCompleted(NULL, &inSize);
+ if (p->OpenCallback)
+ p->Res = p->OpenCallback->SetCompleted(NULL, &inSize);
return (SRes)p->Res;
}
@@ -414,7 +415,10 @@ HRESULT CHandler::Open2(IInStream *inStream, /* UInt32 flags, */ IArchiveOpenCal
}
RINOK(inStream->Seek(0, STREAM_SEEK_END, &_stat.PhySize));
- RINOK(callback->SetTotal(NULL, &_stat.PhySize));
+ if (callback)
+ {
+ RINOK(callback->SetTotal(NULL, &_stat.PhySize));
+ }
CSeekInStreamWrap inStreamImp(inStream);
@@ -466,7 +470,7 @@ STDMETHODIMP CHandler::Open(IInStream *inStream, const UInt64 *, IArchiveOpenCal
COM_TRY_BEGIN
{
Close();
- return Open2(inStream, /* 0, */ callback);
+ return Open2(inStream, callback);
}
COM_TRY_END
}