Make sure there's enough space for lz4 stream buffer.

This commit is contained in:
Bartosz Taudul 2017-09-17 13:24:50 +02:00
parent d7914439e9
commit bf6cbaefd1

View File

@ -14,6 +14,7 @@ using lz4sz_t = uint16_t;
enum { TargetFrameSize = 64000 }; enum { TargetFrameSize = 64000 };
enum { LZ4Size = LZ4_COMPRESSBOUND( TargetFrameSize ) }; enum { LZ4Size = LZ4_COMPRESSBOUND( TargetFrameSize ) };
static_assert( LZ4Size <= std::numeric_limits<lz4sz_t>::max(), "LZ4Size greater than lz4sz_t" ); static_assert( LZ4Size <= std::numeric_limits<lz4sz_t>::max(), "LZ4Size greater than lz4sz_t" );
static_assert( TargetFrameSize * 2 >= 64 * 1024, "Not enough space for LZ4 stream buffer" );
} }