summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-08-29 15:38:26 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-08-29 15:38:26 (GMT)
commitc39235f46e1e23b90a2bc6d6eec509c2c70f149f (patch)
tree76ea0832e697ea0ed412e27d1fce7d601eb26522
parent47b70f4956528d2dbcaf25e4fd04a4f8844bcbf7 (diff)
downloadlz4-c39235f46e1e23b90a2bc6d6eec509c2c70f149f.zip
lz4-c39235f46e1e23b90a2bc6d6eec509c2c70f149f.tar.gz
lz4-c39235f46e1e23b90a2bc6d6eec509c2c70f149f.tar.bz2
fix : lz4frame : added default blockSizeID
-rw-r--r--lz4frame.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lz4frame.c b/lz4frame.c
index 8af9c28..b3c36a5 100644
--- a/lz4frame.c
+++ b/lz4frame.c
@@ -141,6 +141,8 @@ typedef struct {size_t v;} _PACKED size_t_S;
#define MB *(1<<20)
#define GB *(1<<30)
+#define LZ4F_BLOCKSIZEID_DEFAULT 4
+
/**************************************
Structures and local types
@@ -159,6 +161,7 @@ static size_t LZ4F_getBlockSize(unsigned blockSizeID)
{
static const size_t blockSizes[4] = { 64 KB, 256 KB, 1 MB, 4 MB };
+ if (blockSizeID == 0) blockSizeID = LZ4F_BLOCKSIZEID_DEFAULT;
blockSizeID -= 4;
if (blockSizeID > 3) return ERROR_maxBlockSize_invalid;
return blockSizes[blockSizeID];