summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index dd9edcc..87cbb99 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -1271,7 +1271,9 @@ void LZ4_attach_dictionary(LZ4_stream_t *working_stream, const LZ4_stream_t *dic
*/
LZ4_resetStream_fast(working_stream);
- if (dictionary_stream != NULL) {
+ if (dictionary_stream != NULL
+ && dictionary_stream->internal_donotuse.dictSize - 1 >= 4
+ /* intentional underflow */) {
/* 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