summaryrefslogtreecommitdiffstats
path: root/lib/lz4.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lz4.c')
-rw-r--r--lib/lz4.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index 2222d53..d21eef4 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -1236,6 +1236,7 @@ LZ4_FORCE_INLINE int LZ4_compress_generic(
if ((U32)srcSize > (U32)LZ4_MAX_INPUT_SIZE) { return 0; } /* Unsupported srcSize, too large (or negative) */
if (srcSize == 0) { /* src == NULL supported if srcSize == 0 */
+ if (outputDirective != notLimited && dstCapacity <= 0) return 0; /* no output, can't write anything */
DEBUGLOG(5, "Generating an empty block");
assert(outputDirective == notLimited || dstCapacity >= 1);
assert(dst != NULL);