lz4: fix compress max output bound
Max output size can be larger than the source length if the input data is 'too' random. This is normal and thus should be allowed since the caller is expected to have the actual size of the output written to be updated via the dst_len variable. Bug: 111209481 Change-Id: I44a8abb6fb55936f2fd47616954341ba6b0d62ec Signed-off-by: David Lin <dtwlin@google.com>
This commit is contained in:
committed by
Thierry Strudel
parent
83ecaf0401
commit
b843460a55
@@ -942,7 +942,7 @@ EXPORT_SYMBOL(LZ4_compress_fast_continue);
|
||||
int lz4_compress(const unsigned char *src, size_t src_len, unsigned char *dst,
|
||||
size_t *dst_len, void *wrkmem) {
|
||||
*dst_len = LZ4_compress_default(src, dst, src_len,
|
||||
*dst_len, wrkmem);
|
||||
LZ4_COMPRESSBOUND(src_len), wrkmem);
|
||||
|
||||
/*
|
||||
* Prior lz4_compress will return -1 in case of error
|
||||
|
||||
Reference in New Issue
Block a user