[FFmpeg-cvslog] ffplay: Fix invalid array index

Michael Niedermayer git at videolan.org
Fri Aug 26 15:41:04 EEST 2016


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Wed Aug  3 13:15:14 2016 +0200| [486aa4fe39dba347fa0fff42f71697da86c5e1d9] | committer: Michael Niedermayer

ffplay: Fix invalid array index

Found-by: Thomas Guilbert <tguilbert at google.com>
Fixes: clusterfuzz_usan-2016-08-02
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 6cd9a8b67a95a136ea15bfe3c3bab6cf5e6d1cc9)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 ffplay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffplay.c b/ffplay.c
index 74458fd..17327b0 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2869,7 +2869,7 @@ static int read_thread(void *arg)
         AVStream *st = ic->streams[i];
         enum AVMediaType type = st->codec->codec_type;
         st->discard = AVDISCARD_ALL;
-        if (wanted_stream_spec[type] && st_index[type] == -1)
+        if (type >= 0 && wanted_stream_spec[type] && st_index[type] == -1)
             if (avformat_match_stream_specifier(ic, st, wanted_stream_spec[type]) > 0)
                 st_index[type] = i;
     }



More information about the ffmpeg-cvslog mailing list