fecdec: Add another sanity check to find_group().
authorAndre Noll <maan@systemlinux.org>
Fri, 1 May 2009 20:07:49 +0000 (22:07 +0200)
committerAndre Noll <maan@systemlinux.org>
Fri, 1 May 2009 20:07:49 +0000 (22:07 +0200)
fecdec_filter.c

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