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-06-17 21:50:09 +0200
commit7d9725187d1ac027e1659e014e78b73566e76b1d (patch)
tree35f2300b9744f694b4387ca2bde6e846eba0f87d /libavformat
parent80cd5abf7fdb478e8ad83828cab5a10a772a06cc (diff)
downloadffmpeg-7d9725187d1ac027e1659e014e78b73566e76b1d.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 bf07738226..662f02b26a 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1929,7 +1929,7 @@ static int matroska_read_header(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;