avidec: Fix use of stream_index before validation of its range.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-01-23 19:36:22 +01:00
parent d150a147da
commit 14d94a1952
1 changed files with 1 additions and 2 deletions

View File

@ -699,8 +699,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
}
break;
case MKTAG('s', 't', 'r', 'd'):
st = s->streams[stream_index];
if (stream_index >= (unsigned)s->nb_streams || st->codec->extradata_size) {
if (stream_index >= (unsigned)s->nb_streams || s->streams[stream_index]->codec->extradata_size) {
avio_skip(pb, size);
} else {
uint64_t cur_pos = avio_tell(pb);