From 132ab6b63568104d28af23a9682c770a0aaedf03 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Thu, 5 Mar 2009 22:03:14 +0100 Subject: [PATCH] Avoid division by zero in setup_next_fec_group(). This needs more work. --- vss.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vss.c b/vss.c index 4efe38f6..d0e1cf53 100644 --- a/vss.c +++ b/vss.c @@ -238,6 +238,9 @@ static int setup_next_fec_group(struct fec_client *fc, struct vss_task *vsst) fc->group.num_chunks = i - fc->group.first_chunk; fc->slice.num = 0; fc->slice.bytes = ROUND_UP(fc->group.bytes, k) / k; + /* FIXME: Avoid division by zero in a better way */ + if (!fc->slice.bytes) + return 0; /* The last slice will not be fully used */ last_payload_size = fc->group.bytes % fc->slice.bytes; -- 2.39.5