summaryrefslogtreecommitdiffstats
path: root/lib/lz4frame.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lz4frame.c')
-rw-r--r--lib/lz4frame.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/lz4frame.c b/lib/lz4frame.c
index c8e5bde..3c2b788 100644
--- a/lib/lz4frame.c
+++ b/lib/lz4frame.c
@@ -897,10 +897,11 @@ static size_t LZ4F_decodeHeader(LZ4F_dctx* dctxPtr, const void* src, size_t srcS
FREEMEM(dctxPtr->tmpIn);
dctxPtr->tmpIn = (BYTE*)ALLOCATOR(dctxPtr->maxBlockSize);
if (dctxPtr->tmpIn == NULL) return err0r(LZ4F_ERROR_allocation_failed);
- dctxPtr->maxBufferSize = bufferNeeded;
FREEMEM(dctxPtr->tmpOutBuffer);
+ dctxPtr->maxBufferSize = 0;
dctxPtr->tmpOutBuffer= (BYTE*)ALLOCATOR(bufferNeeded);
if (dctxPtr->tmpOutBuffer== NULL) return err0r(LZ4F_ERROR_allocation_failed);
+ dctxPtr->maxBufferSize = bufferNeeded;
} }
dctxPtr->tmpInSize = 0;
dctxPtr->tmpInTarget = 0;