Commit 6cd9a8b6 authored by Michael Niedermayer's avatar Michael Niedermayer

ffplay: Fix invalid array index

Found-by: 's avatarThomas Guilbert <tguilbert@google.com>
Fixes: clusterfuzz_usan-2016-08-02
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 8916ad95
......@@ -2936,7 +2936,7 @@ static int read_thread(void *arg)
AVStream *st = ic->streams[i];
enum AVMediaType type = st->codecpar->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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment