From 081265f1c9f23485b84c03a15817e0e1a8cb6c59 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 7 Jul 2012 20:43:44 +1000 Subject: [PATCH] Use no back end compression for blocks smaller than 64 bytes to avoid issues to do with minimum buffer size and minimum match sizes of the rzip preprocessing. --- stream.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stream.c b/stream.c index ea96e55..663cd4a 100644 --- a/stream.c +++ b/stream.c @@ -1267,7 +1267,11 @@ static void *compthread(void *data) * of succeeding in allocating more ram */ fsync(ctis->fd); retry: - if (!NO_COMPRESS && cti->c_len) { + /* Very small buffers have issues to do with minimum amounts of ram + * allocatable to a buffer combined with the MINIMUM_MATCH of rzip + * being 31 bytes so don't bother trying to compress anything less + * than 64 bytes. */ + if (!NO_COMPRESS && cti->c_len >= 64) { if (LZMA_COMPRESS) ret = lzma_compress_buf(control, cti); else if (LZO_COMPRESS)