[FFmpeg-cvslog] matroskadec: check s->streams[k] before using it
Andreas Cadhalpun
git at videolan.org
Wed Jun 17 22:09:50 CEST 2015
ffmpeg | branch: release/2.2 | Andreas Cadhalpun <andreas.cadhalpun at googlemail.com> | Sun May 3 23:55:20 2015 +0200| [7d9725187d1ac027e1659e014e78b73566e76b1d] | committer: Michael Niedermayer
matroskadec: check s->streams[k] before using it
This fixes a segmentation fault.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit e54540655f229d06667dc7fa7005f2a20e101e80)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7d9725187d1ac027e1659e014e78b73566e76b1d
---
libavformat/matroskadec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index bf07738..662f02b 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;
More information about the ffmpeg-cvslog
mailing list