From 44c5fe64eebb185ecc7a406c3db26721834dbea4 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 1 May 2009 22:07:49 +0200 Subject: [PATCH] fecdec: Add another sanity check to find_group(). --- fecdec_filter.c | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- 2.39.5