mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-02-13 02:44:21 +01:00
Silence dangling pointer warning in lzma enc code.
This commit is contained in:
parent
50ed4896a9
commit
c29eaa3aa5
|
|
@ -2126,6 +2126,8 @@ SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit,
|
|||
UInt64 nowPos64;
|
||||
SRes res;
|
||||
CSeqOutStreamBuf outStream;
|
||||
/* Save original output stream */
|
||||
ISeqOutStream *saved_outStream = p->rc.outStream;
|
||||
|
||||
outStream.funcTable.Write = MyWrite;
|
||||
outStream.data = dest;
|
||||
|
|
@ -2147,6 +2149,10 @@ SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit,
|
|||
|
||||
*unpackSize = (UInt32)(p->nowPos64 - nowPos64);
|
||||
*destLen -= outStream.rem;
|
||||
|
||||
/* Restore original output stream before return */
|
||||
p->rc.outStream = saved_outStream;
|
||||
|
||||
if (outStream.overflow)
|
||||
return SZ_ERROR_OUTPUT_EOF;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue