]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
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 ee3d0d6eac595378f6f4a6380d5c93441602b3aa..5f37f1a81f9199f6080b6669cd455d706a96af06 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;
        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.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;
        }
                *result = fg;
                return 1;
        }