Skip to content

Commit

Permalink
resolve deprecated ZSTD_resetDStream with its equivalent `ZSTD_DCtx_r…
Browse files Browse the repository at this point in the history
…eset(_ctx, ZSTD_reset_session_only);`
  • Loading branch information
sebres committed Feb 15, 2023
1 parent d56903e commit ebe8399
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CPP/7zip/Compress/ZstdDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ HRESULT CDecoder::CodeSpec(ISequentialInStream * inStream,
if (ZSTD_isError(result))
return E_OUTOFMEMORY;
} else {
ZSTD_resetDStream(_ctx);
result = ZSTD_DCtx_reset(_ctx, ZSTD_reset_session_only);
if (ZSTD_isError(result))
return E_FAIL;
}

zOut.dst = _dstBuf;
Expand Down Expand Up @@ -136,7 +138,7 @@ HRESULT CDecoder::CodeSpec(ISequentialInStream * inStream,

/* end of frame */
if (result == 0) {
result = ZSTD_resetDStream(_ctx);
result = ZSTD_DCtx_reset(_ctx, ZSTD_reset_session_only);
if (ZSTD_isError(result))
return E_FAIL;

Expand Down

0 comments on commit ebe8399

Please sign in to comment.