From 2d1cb025887c4c42f03185a29da898d4eceaffa9 Mon Sep 17 00:00:00 2001 From: Aurelien Jacobs Date: Mon, 31 Mar 2008 20:16:04 +0000 Subject: [PATCH] check return value of matroska_find_track_by_num (fix a segfault) Originally committed as revision 12659 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/matroskadec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index a4274f3..86a3994 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -2355,6 +2355,7 @@ matroska_read_header (AVFormatContext *s, for (i=0; inum_indexes; i++) { MatroskaDemuxIndex *idx = &matroska->index[i]; track = matroska_find_track_by_num(matroska, idx->track); + if (track < 0) continue; stream = matroska->tracks[track]->stream_index; if (stream >= 0 && stream < matroska->ctx->nb_streams) av_add_index_entry(matroska->ctx->streams[stream], -- 2.7.4