[FFmpeg-cvslog] matroskadec: check s->streams[k] before using it

Andreas Cadhalpun git at videolan.org
Thu May 14 20:58:41 CEST 2015


ffmpeg | branch: release/2.6 | Andreas Cadhalpun <andreas.cadhalpun at googlemail.com> | Sun May  3 23:55:20 2015 +0200| [35013fa23aba73ac7203dbd4d793167b2685a389] | committer: Andreas Cadhalpun

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: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=35013fa23aba73ac7203dbd4d793167b2685a389
---

 libavformat/matroskadec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 0756d04..d1e758a 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2004,7 +2004,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;



More information about the ffmpeg-cvslog mailing list