[FFmpeg-cvslog] snowdec: add 2 av_asserts to check run validity

Michael Niedermayer git at videolan.org
Thu Aug 16 01:50:00 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Aug 16 01:35:10 2012 +0200| [6ecf1eb0ddad4732fa90cbec1b13d9f3d2efa940] | committer: Michael Niedermayer

snowdec: add 2 av_asserts to check run validity

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6ecf1eb0ddad4732fa90cbec1b13d9f3d2efa940
---

 libavcodec/snow.h |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/snow.h b/libavcodec/snow.h
index 30e6a9a..6d6b086 100644
--- a/libavcodec/snow.h
+++ b/libavcodec/snow.h
@@ -664,11 +664,13 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i
                     int max_run;
                     run--;
                     v=0;
-
+                    av_assert2(run >= 0);
                     if(y) max_run= FFMIN(run, prev_xc->x - x - 2);
                     else  max_run= FFMIN(run, w-x-1);
                     if(parent_xc)
                         max_run= FFMIN(max_run, 2*parent_xc->x - x - 1);
+                    av_assert2(max_run >= 0 && max_run <= run);
+
                     x+= max_run;
                     run-= max_run;
                 }



More information about the ffmpeg-cvslog mailing list