Mercurial > libavformat.hg
changeset 3138:ce03321a2cc8 libavformat
add out of bound stream index checks
fix issue379
author | aurel |
---|---|
date | Mon, 10 Mar 2008 21:23:06 +0000 |
parents | 20db4653d696 |
children | 4e6f5edefa76 |
files | matroskadec.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/matroskadec.c Mon Mar 10 21:09:27 2008 +0000 +++ b/matroskadec.c Mon Mar 10 21:23:06 2008 +0000 @@ -2356,7 +2356,7 @@ MatroskaDemuxIndex *idx = &matroska->index[i]; track = matroska_find_track_by_num(matroska, idx->track); stream = matroska->tracks[track]->stream_index; - if (stream >= 0) + if (stream >= 0 && stream < matroska->ctx->nb_streams) av_add_index_entry(matroska->ctx->streams[stream], idx->pos, idx->time/matroska->time_scale, 0, 0, AVINDEX_KEYFRAME); @@ -2400,7 +2400,7 @@ return res; } stream_index = matroska->tracks[track]->stream_index; - if (stream_index < 0) { + if (stream_index < 0 || stream_index >= matroska->ctx->nb_streams) { av_free(origdata); return res; }