aboutsummaryrefslogtreecommitdiffstats
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-01 23:25:22 +0200
commit84cc40cbe154ecc7ad460b879d39ad9df62957a6 (patch)
treebdadd1232f4beb93dde16ec0120c902fb820695f
parent43bfe0ada57f585f79b06215d6e0e9976e6e59c8 (diff)
downloadffmpeg-84cc40cbe154ecc7ad460b879d39ad9df62957a6.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>
-rw-r--r--libavformat/matroskadec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index c06bc2e6be..7618284d8c 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1942,7 +1942,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;