vss: Handle empty chunk groups gracefully.
[paraslash.git] / vss.c
diff --git a/vss.c b/vss.c
index 9857d92dcd7e0e32721aaca15a86fc27fc061292..101fdb8818b4fe8ca794bda2cd71a385b093df02 100644 (file)
--- 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;