contrib/python-zstandard/zstd/common/fse.h
changeset 43994 de7838053207
parent 42937 69de49c4e39c
--- a/contrib/python-zstandard/zstd/common/fse.h	Fri Dec 27 18:54:57 2019 -0500
+++ b/contrib/python-zstandard/zstd/common/fse.h	Sat Dec 28 09:55:45 2019 -0800
@@ -308,7 +308,7 @@
 *******************************************/
 /* FSE buffer bounds */
 #define FSE_NCOUNTBOUND 512
-#define FSE_BLOCKBOUND(size) (size + (size>>7))
+#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 */