summaryrefslogtreecommitdiff
path: root/ffplay.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-08-03 13:15:14 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-08-15 20:25:13 +0200
commit486aa4fe39dba347fa0fff42f71697da86c5e1d9 (patch)
tree7f0caa13ad584a43b91e61198a0d4075b1def15a /ffplay.c
parentda12d544bf0b28f0af78af2b9ce00ad791218472 (diff)
downloadffmpeg-486aa4fe39dba347fa0fff42f71697da86c5e1d9.tar.gz
ffplay: Fix invalid array index
Found-by: Thomas Guilbert <tguilbert@google.com> Fixes: clusterfuzz_usan-2016-08-02 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 6cd9a8b67a95a136ea15bfe3c3bab6cf5e6d1cc9) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ffplay.c b/ffplay.c
index 74458fde40..17327b036b 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;
}