summaryrefslogtreecommitdiff
path: root/libavformat/matroskadec.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2008-03-31 20:16:04 +0000
committerAurelien Jacobs <aurel@gnuage.org>2008-03-31 20:16:04 +0000
commit2d1cb025887c4c42f03185a29da898d4eceaffa9 (patch)
tree61d3ce8bbaf34c74a210770ed48808fe52249719 /libavformat/matroskadec.c
parent4477dedc4f7a0ca11c1c1f8f31dbd51cbbec10fa (diff)
downloadffmpeg-2d1cb025887c4c42f03185a29da898d4eceaffa9.tar.gz
check return value of matroska_find_track_by_num (fix a segfault)
Originally committed as revision 12659 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r--libavformat/matroskadec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index a4274f310f..86a3994808 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2355,6 +2355,7 @@ matroska_read_header (AVFormatContext *s,
for (i=0; i<matroska->num_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],