[FFmpeg-cvslog] avcodec/aacsbr: Replace impossible condition by assert

Michael Niedermayer git at videolan.org
Tue Mar 17 22:57:05 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Mar 17 22:39:01 2015 +0100| [0b961423ee9fc5362956cc92f2189289060b6953] | committer: Michael Niedermayer

avcodec/aacsbr: Replace impossible condition by assert

bits can have a value of 0 or 1 they are never -1 or otherwise negative

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

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

 libavcodec/aacsbr.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c
index aa88e25..b582d3f 100644
--- a/libavcodec/aacsbr.c
+++ b/libavcodec/aacsbr.c
@@ -728,7 +728,8 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
         break;
     }
 
-    if (bs_pointer < 0 || bs_pointer > ch_data->bs_num_env + 1) {
+    av_assert0(bs_pointer >= 0);
+    if (bs_pointer > ch_data->bs_num_env + 1) {
         av_log(ac->avctx, AV_LOG_ERROR,
                "Invalid bitstream, bs_pointer points to a middle noise border outside the time borders table: %d\n",
                bs_pointer);



More information about the ffmpeg-cvslog mailing list