]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Adding 4 blocks to FSE_BLOCKBOUND() in lib/common (different from last week)
authorBimba Shrestha <bimbashrestha@fb.com>
Wed, 18 Sep 2019 20:29:05 +0000 (13:29 -0700)
committerBimba Shrestha <bimbashrestha@fb.com>
Wed, 18 Sep 2019 20:29:05 +0000 (13:29 -0700)
lib/common/fse.h

index 811c670bddc30d0518e01b9db1c2fe14eb6acec1..deac3f9918ae2e078d5f130f1308a0613f9fb7a6 100644 (file)
@@ -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 */