From 373cfa25e4d339a23fc846c51b68dd2d0c84ac18 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 23 Mar 2011 08:44:52 +1100 Subject: [PATCH] limit must still be clamped to chunk_limit at most. --- stream.c | 1 + 1 file changed, 1 insertion(+) diff --git a/stream.c b/stream.c index 43e6ffb..9832c62 100644 --- a/stream.c +++ b/stream.c @@ -998,6 +998,7 @@ void *open_stream_out(rzip_control *control, int f, unsigned int n, i64 chunk_li } /* Use a nominal minimum size should we fail all previous shrinking */ limit = MAX(limit, STREAM_BUFSIZE); + limit = MIN(limit, chunk_limit); retest_malloc: testsize = limit + (control->overhead * control->threads); testmalloc = malloc(testsize);