From: Andre Noll <maan@systemlinux.org>
Date: Fri, 1 May 2009 11:42:21 +0000 (+0200)
Subject: fecdec: Be more anal when finding fec groups.
X-Git-Tag: v0.3.4~9
X-Git-Url: https://git.tuebingen.mpg.de/?a=commitdiff_plain;h=dda0ca96680692eed43b95e335e6bb3c01c221b3;p=paraslash.git

fecdec: Be more anal when finding fec groups.

If the number of (data) slices changes, there's something seriously
wrong. So return an error if we detect this situation.
---

diff --git a/fecdec_filter.c b/fecdec_filter.c
index 817e4c66..ee3d0d6e 100644
--- a/fecdec_filter.c
+++ b/fecdec_filter.c
@@ -118,9 +118,9 @@ static int find_group(struct fec_header *h,
 		if (fg->h.group_num != h->group_num)
 			continue;
 		if (fg->h.slices_per_group != h->slices_per_group)
-			continue;
+			return -E_BAD_FEC_HEADER;
 		if (fg->h.data_slices_per_group != h->data_slices_per_group)
-			continue;
+			return -E_BAD_FEC_HEADER;
 		*result = fg;
 		return 1;
 	}