limit must still be clamped to chunk_limit at most.

This commit is contained in:
Con Kolivas 2011-03-23 08:44:52 +11:00
parent e561a9a080
commit 373cfa25e4

View file

@ -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);