aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-08-03 13:15:14 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-08-13 13:08:57 +0200
commit7876fd679d98531a2b3c864d40eafd42de938d3f (patch)
tree6d7a2ee457e4cec370caf35b94557d30e71a8428
parent8b3d9c33d617d2a94c8733e4a57a8040ae1d41f5 (diff)
downloadffmpeg-7876fd679d98531a2b3c864d40eafd42de938d3f.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>
-rw-r--r--ffplay.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ffplay.c b/ffplay.c
index 3df0d4dd72..97c356f835 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2931,7 +2931,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;
}