changeset 3147:99263b3a00e1 libavcodec

replace for loop with 2 asserts()
author michael
date Sun, 26 Feb 2006 15:24:42 +0000
parents dcae1bde37ac
children d4d8e5436be7
files dv.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dv.c	Sat Feb 25 22:58:26 2006 +0000
+++ b/dv.c	Sun Feb 26 15:24:42 2006 +0000
@@ -746,6 +746,7 @@
                     b->bit_size[a] = 1; // 4 areas 4 bits for EOB :)
                     b->area_q[a]++;
                     prev= b->prev[a];
+                    assert(b->next[prev] >= mb_area_start[a+1] || b->mb[prev]);
                     for (k= b->next[prev] ; k<mb_area_start[a+1]; k= b->next[k]) {
                        b->mb[k] >>= 1;
                        if (b->mb[k]) {
@@ -759,8 +760,8 @@
                                 assert(b->mb[b->next[k]]);
                                 b->bit_size[a2] += dv_rl2vlc_size(b->next[k] - prev - 1, b->mb[b->next[k]])
                                                   -dv_rl2vlc_size(b->next[k] -    k - 1, b->mb[b->next[k]]);
-                                for(; (b->prev[a2]==k) && (a2<4); a2++)
-                                        b->prev[a2] = prev;
+                                assert(b->prev[a2]==k && (a2+1 >= 4 || b->prev[a2+1]!=k));
+                                b->prev[a2] = prev;
                            }
                            b->next[prev] = b->next[k];
                        }