fix temporary buffer use when input size hint is respected
authorNiko Dzhus <primenico@gmail.com>
Fri, 24 May 2019 15:25:06 +0000 (18:25 +0300)
committerNiko Dzhus <primenico@gmail.com>
Fri, 24 May 2019 19:08:44 +0000 (22:08 +0300)
lib/lz4frame.c

index 95b8b8e..cc7f2d5 100644 (file)
@@ -1494,7 +1494,7 @@ size_t LZ4F_decompress(LZ4F_dctx* dctx,
                 /* next block is a compressed block */
                 dctx->tmpInTarget = nextCBlockSize + crcSize;
                 dctx->dStage = dstage_getCBlock;
-                if (dstPtr==dstEnd) {
+                if (dstPtr==dstEnd || srcPtr==srcEnd) {
                     nextSrcSizeHint = BHSize + nextCBlockSize + crcSize;
                     doAnotherStage = 0;
                 }