From f9b6abb896fb05027f242c526bb54719e124b24f Mon Sep 17 00:00:00 2001 From: Bimba Shrestha Date: Wed, 18 Sep 2019 13:29:05 -0700 Subject: [PATCH 1/2] Adding 4 blocks to FSE_BLOCKBOUND() in lib/common (different from last week) --- lib/common/fse.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common/fse.h b/lib/common/fse.h index 811c670bd..deac3f991 100644 --- a/lib/common/fse.h +++ b/lib/common/fse.h @@ -308,7 +308,7 @@ If there is an error, the function will return an error code, which can be teste *******************************************/ /* FSE buffer bounds */ #define FSE_NCOUNTBOUND 512 -#define FSE_BLOCKBOUND(size) (size + (size>>7)) +#define FSE_BLOCKBOUND(size) (size + (size>>7) + 4 /* constant for initial fse states */) #define FSE_COMPRESSBOUND(size) (FSE_NCOUNTBOUND + FSE_BLOCKBOUND(size)) /* Macro version, useful for static allocation */ /* It is possible to statically allocate FSE CTable/DTable as a table of FSE_CTable/FSE_DTable using below macros */ From 6e9f6813bb6d96a95c18049dd5a37c517a6664f5 Mon Sep 17 00:00:00 2001 From: Bimba Shrestha Date: Wed, 18 Sep 2019 13:49:45 -0700 Subject: [PATCH 2/2] adding bit container size --- lib/common/fse.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common/fse.h b/lib/common/fse.h index deac3f991..a7553e372 100644 --- a/lib/common/fse.h +++ b/lib/common/fse.h @@ -308,7 +308,7 @@ If there is an error, the function will return an error code, which can be teste *******************************************/ /* FSE buffer bounds */ #define FSE_NCOUNTBOUND 512 -#define FSE_BLOCKBOUND(size) (size + (size>>7) + 4 /* constant for initial fse states */) +#define FSE_BLOCKBOUND(size) (size + (size>>7) + 4 /* fse states */ + sizeof(size_t) /* bitContainer */) #define FSE_COMPRESSBOUND(size) (FSE_NCOUNTBOUND + FSE_BLOCKBOUND(size)) /* Macro version, useful for static allocation */ /* It is possible to statically allocate FSE CTable/DTable as a table of FSE_CTable/FSE_DTable using below macros */