[FFmpeg-cvslog] h264: silence warning about array index being out of bounds

Michael Niedermayer git at videolan.org
Sat Feb 2 16:26:59 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Feb  2 16:20:19 2013 +0100| [cdc48860a8cbb0080acc0732b2e1c689cea03777] | committer: Michael Niedermayer

h264: silence warning about array index being out of bounds

The index is not out of bounds, adding an assert makes gcc
realize this.

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

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

 libavcodec/h264.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 3d759cc..50839bd 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3906,6 +3906,7 @@ static int execute_decode_slices(H264Context *h, int context_count)
     if (context_count == 1) {
         return decode_slice(avctx, &h);
     } else {
+        av_assert0(context_count > 0);
         for (i = 1; i < context_count; i++) {
             hx                    = h->thread_context[i];
             hx->s.err_recognition = avctx->err_recognition;



More information about the ffmpeg-cvslog mailing list