Commit 2d1cb025 authored by Aurelien Jacobs's avatar Aurelien Jacobs

check return value of matroska_find_track_by_num (fix a segfault)

Originally committed as revision 12659 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 4477dedc
...@@ -2355,6 +2355,7 @@ matroska_read_header (AVFormatContext *s, ...@@ -2355,6 +2355,7 @@ matroska_read_header (AVFormatContext *s,
for (i=0; i<matroska->num_indexes; i++) { for (i=0; i<matroska->num_indexes; i++) {
MatroskaDemuxIndex *idx = &matroska->index[i]; MatroskaDemuxIndex *idx = &matroska->index[i];
track = matroska_find_track_by_num(matroska, idx->track); track = matroska_find_track_by_num(matroska, idx->track);
if (track < 0) continue;
stream = matroska->tracks[track]->stream_index; stream = matroska->tracks[track]->stream_index;
if (stream >= 0 && stream < matroska->ctx->nb_streams) if (stream >= 0 && stream < matroska->ctx->nb_streams)
av_add_index_entry(matroska->ctx->streams[stream], av_add_index_entry(matroska->ctx->streams[stream],
......
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