aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>2015-05-03 23:55:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-21 20:43:37 +0200
commit39115c01f09e82740607fe22f54c5de8c0659ffb (patch)
tree4b807cc66b3be739541d9f04d0984d5f05080652 /libavformat
parente337d5f1b1a6f41acfdff3302d9ff85c91b7a0bd (diff)
downloadffmpeg-39115c01f09e82740607fe22f54c5de8c0659ffb.tar.gz
matroskadec: check s->streams[k] before using it
This fixes a segmentation fault. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit e54540655f229d06667dc7fa7005f2a20e101e80) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/matroskadec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 6963d54de6..20389415a9 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1948,7 +1948,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
snprintf(buf, sizeof(buf), "%s_%d",
ff_matroska_video_stereo_plane[planes[j].type], i);
for (k=0; k < matroska->tracks.nb_elem; k++)
- if (planes[j].uid == tracks[k].uid) {
+ if (planes[j].uid == tracks[k].uid && s->streams[k]) {
av_dict_set(&s->streams[k]->metadata,
"stereo_mode", buf, 0);
break;