]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
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 817e4c66c7bc96a2e59b5b7230d8b490633dbbb6..ee3d0d6eac595378f6f4a6380d5c93441602b3aa 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)
                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)
                if (fg->h.data_slices_per_group != h->data_slices_per_group)
-                       continue;
+                       return -E_BAD_FEC_HEADER;
                *result = fg;
                return 1;
        }
                *result = fg;
                return 1;
        }