summaryrefslogtreecommitdiffstats
path: root/lib/lz4.c
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2015-04-12 08:29:52 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2015-04-12 08:29:52 (GMT)
commit81fdd9df23821d5db8331e66478e2617b470820c (patch)
tree654af31034b520af11aec51d366d8255c96aaaba /lib/lz4.c
parent66b8a4a8afe72ac37a26199249a78a5349201472 (diff)
downloadlz4-81fdd9df23821d5db8331e66478e2617b470820c.zip
lz4-81fdd9df23821d5db8331e66478e2617b470820c.tar.gz
lz4-81fdd9df23821d5db8331e66478e2617b470820c.tar.bz2
Fixed a few Valgrind warnings
Diffstat (limited to 'lib/lz4.c')
-rw-r--r--lib/lz4.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index d6fdcd9..e57d080 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -756,6 +756,7 @@ int LZ4_freeStream (LZ4_stream_t* LZ4_stream)
}
+#define HASH_UNIT sizeof(size_t)
int LZ4_loadDict (LZ4_stream_t* LZ4_dict, const char* dictionary, int dictSize)
{
LZ4_stream_t_internal* dict = (LZ4_stream_t_internal*) LZ4_dict;
@@ -765,7 +766,7 @@ int LZ4_loadDict (LZ4_stream_t* LZ4_dict, const char* dictionary, int dictSize)
if (dict->initCheck) LZ4_resetStream(LZ4_dict); /* Uninitialized structure detected */
- if (dictSize < MINMATCH)
+ if (dictSize < HASH_UNIT)
{
dict->dictionary = NULL;
dict->dictSize = 0;
@@ -778,7 +779,7 @@ int LZ4_loadDict (LZ4_stream_t* LZ4_dict, const char* dictionary, int dictSize)
dict->dictSize = (U32)(dictEnd - p);
dict->currentOffset += dict->dictSize;
- while (p <= dictEnd-MINMATCH)
+ while (p <= dictEnd-HASH_UNIT)
{
LZ4_putPosition(p, dict, byU32, base);
p+=3;