From: Andre Noll Date: Fri, 1 May 2009 20:07:49 +0000 (+0200) Subject: fecdec: Add another sanity check to find_group(). X-Git-Tag: v0.3.4~6 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=44c5fe64eebb185ecc7a406c3db26721834dbea4;p=paraslash.git fecdec: Add another sanity check to find_group(). --- diff --git a/fecdec_filter.c b/fecdec_filter.c index ee3d0d6e..5f37f1a8 100644 --- a/fecdec_filter.c +++ b/fecdec_filter.c @@ -117,10 +117,15 @@ static int find_group(struct fec_header *h, FOR_EACH_FECDEC_GROUP(fg, pfd) { if (fg->h.group_num != h->group_num) continue; + if (fg->num_received_slices == 0) + goto success; if (fg->h.slices_per_group != h->slices_per_group) return -E_BAD_FEC_HEADER; if (fg->h.data_slices_per_group != h->data_slices_per_group) return -E_BAD_FEC_HEADER; + if (fg->h.group_bytes != h->group_bytes) + return -E_BAD_FEC_HEADER; +success: *result = fg; return 1; }