From: Andre Noll Date: Mon, 20 Sep 2021 17:15:12 +0000 (+0200) Subject: vss: Handle empty chunk groups gracefully. X-Git-Tag: v0.6.4~13 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=6428bef6e3c172851dc97c3e126f438c7aaf0695;ds=inline vss: Handle empty chunk groups gracefully. The assertion in compute_group_size() triggers if the stream is positioned right at the end of the file when the next chunk group starts. This was observed with an mp3 file and the udp sender when pausing and restarting the stream at the end of the file. Fix this braino by returning EOF instead of aborting if the next chunk group happens to be empty. --- diff --git a/vss.c b/vss.c index 9857d92d..101fdb88 100644 --- a/vss.c +++ b/vss.c @@ -416,7 +416,8 @@ static int compute_group_size(struct vss_task *vsst, struct fec_group *g, g->bytes += len; g->num_chunks++; } - assert(g->num_chunks); + if (g->num_chunks == 0) + return -E_EOF; PARA_DEBUG_LOG("group #%u: %u chunks, %u bytes total\n", g->num, g->num_chunks, g->bytes); return 1;