summaryrefslogtreecommitdiff
path: root/lib/lz4.c
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2019-12-03 14:49:22 -0800
committerYann Collet <cyan@fb.com>2019-12-03 14:49:22 -0800
commitd755f87f9fb7d625cdb9c9b54ab02e451cd80e9e (patch)
tree311b035c09add59f2e7e18b3b4dabb951bfbd704 /lib/lz4.c
parent0f6cbd996fbaade6715c7009c6f8dbb0f23f0b4b (diff)
downloadlz4-d755f87f9fb7d625cdb9c9b54ab02e451cd80e9e.tar.gz
lz4-d755f87f9fb7d625cdb9c9b54ab02e451cd80e9e.tar.bz2
lz4-d755f87f9fb7d625cdb9c9b54ab02e451cd80e9e.zip
fixed lz4hc assert error
when src ptr is in very low memory area (< 64K), the virtual reference to data in dictionary might end up in a very high memory address. Since it's not a "real" memory address, just a virtual one, to calculate distance, it doesn't matter : only distance matters. The assert was to restrictive. Fixed.
Diffstat (limited to 'lib/lz4.c')
-rw-r--r--lib/lz4.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index 866855b..fc3fb88 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -225,15 +225,15 @@ static const int LZ4_minLength = (MFLIMIT+1);
#if defined(LZ4_DEBUG) && (LZ4_DEBUG>=2)
# include <stdio.h>
-static int g_debuglog_enable = 1;
-# define DEBUGLOG(l, ...) { \
- if ((g_debuglog_enable) && (l<=LZ4_DEBUG)) { \
- fprintf(stderr, __FILE__ ": "); \
- fprintf(stderr, __VA_ARGS__); \
- fprintf(stderr, " \n"); \
- } }
+ static int g_debuglog_enable = 1;
+# define DEBUGLOG(l, ...) { \
+ if ((g_debuglog_enable) && (l<=LZ4_DEBUG)) { \
+ fprintf(stderr, __FILE__ ": "); \
+ fprintf(stderr, __VA_ARGS__); \
+ fprintf(stderr, " \n"); \
+ } }
#else
-# define DEBUGLOG(l, ...) {} /* disabled */
+# define DEBUGLOG(l, ...) {} /* disabled */
#endif