better consistency in accessing @input

as suggested by @terrelln.

Also : commented zstreamtest more
to ensure ZSTD_stableInBuffer is tested/
This commit is contained in:
Yann Collet
2022-01-26 10:31:24 -08:00
parent 8296be4a0a
commit 270f9bf005
2 changed files with 14 additions and 9 deletions
+1 -1
View File
@@ -5660,7 +5660,7 @@ size_t ZSTD_compressStream2( ZSTD_CCtx* cctx,
if (cctx->savedInPosPlusOne == 0) cctx->savedInPosPlusOne = input->pos + 1;
cctx->expectedInBuffer = *input;
/* pretend input was consumed, to give a sense forward progress */
input[0].pos = input[0].size;
input->pos = input->size;
/* but actually input wasn't consumed, so keep track of position from where compression shall resume */
cctx->expectedInBuffer.pos = cctx->savedInPosPlusOne - 1;
/* don't initialize yet, wait for the first block of flush() order, for better parameters adaptation */