fecdec: Be more anal when finding fec groups.
authorAndre Noll <maan@systemlinux.org>
Fri, 1 May 2009 11:42:21 +0000 (13:42 +0200)
committerAndre Noll <maan@systemlinux.org>
Fri, 1 May 2009 11:42:21 +0000 (13:42 +0200)
If the number of (data) slices changes, there's something seriously
wrong. So return an error if we detect this situation.

fecdec_filter.c

index 817e4c6..ee3d0d6 100644 (file)
@@ -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;
        }