summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNick Terrell <terrelln@fb.com>2019-07-18 02:40:04 (GMT)
committerNick Terrell <terrelln@fb.com>2019-07-18 19:29:15 (GMT)
commit1f236e0790ab28a223e89bbb8e65d3ed067adc89 (patch)
tree56b2df642b046da2b7f81e8e5747bbdaee67616d /lib
parent675ef9a9fc9899667d0fe9b7b2a66e402e870a6d (diff)
downloadlz4-1f236e0790ab28a223e89bbb8e65d3ed067adc89.zip
lz4-1f236e0790ab28a223e89bbb8e65d3ed067adc89.tar.gz
lz4-1f236e0790ab28a223e89bbb8e65d3ed067adc89.tar.bz2
Fix LZ4_attach_dictionary with empty dictionary
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4.c2
1 files changed, 1 insertions, 1 deletions
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