From f2b5852872a0dca7a11b298bd29f0f70b16b9ad4 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 30 Nov 2010 11:22:02 +1100 Subject: [PATCH] Fix divide by zero error when a file is smaller than the page size and compressed with -U. --- rzip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rzip.c b/rzip.c index b725abc..fb95247 100644 --- a/rzip.c +++ b/rzip.c @@ -105,6 +105,8 @@ struct sliding_buffer { static void round_to_page(i64 *size) { *size -= *size % control.page_size; + if (unlikely(!*size)) + *size = control.page_size; } static void remap_low_sb(void)