diff options
Diffstat (limited to 'CPP/7zip/Archive/Zip/ZipAddCommon.cpp')
-rwxr-xr-x | CPP/7zip/Archive/Zip/ZipAddCommon.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/CPP/7zip/Archive/Zip/ZipAddCommon.cpp b/CPP/7zip/Archive/Zip/ZipAddCommon.cpp index ae75a1a2..4c5fd38d 100755 --- a/CPP/7zip/Archive/Zip/ZipAddCommon.cpp +++ b/CPP/7zip/Archive/Zip/ZipAddCommon.cpp @@ -53,18 +53,17 @@ HRESULT CLzmaEncoder::SetCoderProperties(const PROPID *propIDs, const PROPVARIAN EncoderSpec = new NCompress::NLzma::CEncoder; Encoder = EncoderSpec; } - CSequentialOutStreamImp *outStreamSpec = new CSequentialOutStreamImp; + CBufPtrSeqOutStream *outStreamSpec = new CBufPtrSeqOutStream; CMyComPtr<ISequentialOutStream> outStream(outStreamSpec); - outStreamSpec->Init(); + outStreamSpec->Init(Header + 4, kLzmaPropsSize); RINOK(EncoderSpec->SetCoderProperties(propIDs, props, numProps)); RINOK(EncoderSpec->WriteCoderProperties(outStream)); - if (outStreamSpec->GetSize() != kLzmaPropsSize) + if (outStreamSpec->GetPos() != kLzmaPropsSize) return E_FAIL; Header[0] = MY_VER_MAJOR; Header[1] = MY_VER_MINOR; Header[2] = kLzmaPropsSize; Header[3] = 0; - memcpy(Header + 4, outStreamSpec->GetBuffer(), kLzmaPropsSize); return S_OK; } |