1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

snowdec: add 2 av_asserts to check run validity

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-08-16 01:35:10 +02:00
parent 4a596d19ff
commit 6ecf1eb0dd

View File

@ -664,11 +664,13 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i
int max_run; int max_run;
run--; run--;
v=0; v=0;
av_assert2(run >= 0);
if(y) max_run= FFMIN(run, prev_xc->x - x - 2); if(y) max_run= FFMIN(run, prev_xc->x - x - 2);
else max_run= FFMIN(run, w-x-1); else max_run= FFMIN(run, w-x-1);
if(parent_xc) if(parent_xc)
max_run= FFMIN(max_run, 2*parent_xc->x - x - 1); max_run= FFMIN(max_run, 2*parent_xc->x - x - 1);
av_assert2(max_run >= 0 && max_run <= run);
x+= max_run; x+= max_run;
run-= max_run; run-= max_run;
} }