[FFmpeg-cvslog] avcodec/svq1dec: Add assert to ensure "stages >= 0"

Michael Niedermayer git at videolan.org
Tue Feb 3 23:20:56 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Feb  3 23:03:38 2015 +0100| [741b56fceece2b2de53466b952ed60b61544cc60] | committer: Michael Niedermayer

avcodec/svq1dec: Add assert to ensure "stages >= 0"

This is currently always true, the assert protects against
future changes to the code breaking this assumtation

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

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

 libavcodec/svq1dec.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
index 9484653..a95c7c8 100644
--- a/libavcodec/svq1dec.c
+++ b/libavcodec/svq1dec.c
@@ -193,6 +193,7 @@ static int svq1_decode_block_intra(GetBitContext *bitbuf, uint8_t *pixels,
                     stages, level);
             return AVERROR_INVALIDDATA;  /* invalid vector */
         }
+        av_assert0(stages >= 0);
 
         mean = get_vlc2(bitbuf, svq1_intra_mean.table, 8, 3);
 
@@ -255,6 +256,7 @@ static int svq1_decode_block_non_intra(GetBitContext *bitbuf, uint8_t *pixels,
                     stages, level);
             return AVERROR_INVALIDDATA;  /* invalid vector */
         }
+        av_assert0(stages >= 0);
 
         mean = get_vlc2(bitbuf, svq1_inter_mean.table, 9, 3) - 256;
 



More information about the ffmpeg-cvslog mailing list