Try safe version

This commit is contained in:
Danila Kutenin 2019-04-19 15:34:56 +03:00
parent e34e396ff9
commit c7731b32f1

View File

@ -46,9 +46,9 @@ UInt32 CompressionCodecLZ4::doCompressData(const char * source, UInt32 source_si
return LZ4_compress_default(source, dest, source_size, LZ4_COMPRESSBOUND(source_size));
}
void CompressionCodecLZ4::doDecompressData(const char * source, UInt32, char * dest, UInt32 uncompressed_size) const
void CompressionCodecLZ4::doDecompressData(const char * source, UInt32 source_size, char * dest, UInt32 uncompressed_size) const
{
if (LZ4_decompress_fast(source, dest, uncompressed_size) < 0)
if (LZ4_decompress_safe(source, dest, source_size, uncompressed_size) < 0)
throw Exception("Cannot LZ4_decompress_safe", ErrorCodes::CANNOT_DECOMPRESS);
// LZ4::decompress(source, dest, source_size, uncompressed_size, lz4_stat);
}