From 1f236e0790ab28a223e89bbb8e65d3ed067adc89 Mon Sep 17 00:00:00 2001 From: Nick Terrell Date: Wed, 17 Jul 2019 19:40:04 -0700 Subject: [PATCH] Fix LZ4_attach_dictionary with empty dictionary --- lib/lz4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lz4.c b/lib/lz4.c index 74a9247..81b3c10 100644 --- a/lib/lz4.c +++ b/lib/lz4.c @@ -1429,7 +1429,7 @@ void LZ4_attach_dictionary(LZ4_stream_t* workingStream, const LZ4_stream_t* dict */ LZ4_resetStream_fast(workingStream); - if (dictionaryStream != NULL) { + if (dictionaryStream != NULL && dictionaryStream->internal_donotuse.dictSize > 0) { /* If the current offset is zero, we will never look in the * external dictionary context, since there is no value a table * entry can take that indicate a miss. In that case, we need