Fix Segfault When Copying Dict
authorW. Felix Handte <w@felixhandte.com>
Fri, 22 Sep 2017 18:52:29 +0000 (11:52 -0700)
committerW. Felix Handte <w@felixhandte.com>
Fri, 22 Sep 2017 20:20:49 +0000 (13:20 -0700)
dctx must have been initialized before we can copy the dictionary in.

lib/lz4frame.c

index 3408708..166d583 100644 (file)
@@ -1616,6 +1616,7 @@ size_t LZ4F_decompress(LZ4F_dctx* dctx,
     if ( (dctx->frameInfo.blockMode==LZ4F_blockLinked)
       && (dctx->dict != dctx->tmpOutBuffer)
       && (dctx->dStage != dstage_getFrameHeader)
+      && (dctx->dStage != dstage_storeFrameHeader)
       && (!decompressOptionsPtr->stableDst)
       && ((unsigned)(dctx->dStage-1) < (unsigned)(dstage_getSuffix-1)) )
     {