[FFmpeg-cvslog] avcodec/vp9: add a never triggerable assert.

Clément Bœsch git at videolan.org
Sat Nov 16 22:34:28 CET 2013


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Sat Nov 16 21:18:53 2013 +0100| [7e704b1e109b3c48b3175bf0eac7bb5bf0c66e75] | committer: Clément Bœsch

avcodec/vp9: add a never triggerable assert.

vp8_rac_get_tree() is called with a tree of size 3, so the returned
value can not be outside [0;3]. All of the [0;3] cases are handled in
the switch, so the assert should not be triggerable by any means. A
similar change was introduced in 97962b2 / 72ca830, with the
av_log()+AVERROR_INVALIDDATA form, suggesting it could be triggerable
somehow. This assert might help static analyzer, or simply the reader.

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

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

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 4978915..e2cb388 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -2768,6 +2768,8 @@ static int decode_sb(AVCodecContext *ctx, int row, int col, struct VP9Filter *lf
                     }
                 }
                 break;
+            default:
+                av_assert0(0);
             }
         } else if (vp56_rac_get_prob_branchy(&s->c, p[1])) {
             bp = PARTITION_SPLIT;



More information about the ffmpeg-cvslog mailing list