diff options
author | Yann Collet <yann.collet.73@gmail.com> | 2014-08-29 15:38:26 (GMT) |
---|---|---|
committer | Yann Collet <yann.collet.73@gmail.com> | 2014-08-29 15:38:26 (GMT) |
commit | c39235f46e1e23b90a2bc6d6eec509c2c70f149f (patch) | |
tree | 76ea0832e697ea0ed412e27d1fce7d601eb26522 | |
parent | 47b70f4956528d2dbcaf25e4fd04a4f8844bcbf7 (diff) | |
download | lz4-c39235f46e1e23b90a2bc6d6eec509c2c70f149f.zip lz4-c39235f46e1e23b90a2bc6d6eec509c2c70f149f.tar.gz lz4-c39235f46e1e23b90a2bc6d6eec509c2c70f149f.tar.bz2 |
fix : lz4frame : added default blockSizeID
-rw-r--r-- | lz4frame.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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]; |