[FFmpeg-cvslog] avformat/matroskadec: Check avpriv_new_chapter() for failure

Justin Jacobs git at videolan.org
Fri Aug 8 21:17:14 CEST 2014


ffmpeg | branch: master | Justin Jacobs <jajdorkster at gmail.com> | Wed Aug  6 20:04:38 2014 -0400| [87dc8b3af9135f0cfcdf3c0520e3f29e7b0d92c6] | committer: Michael Niedermayer

avformat/matroskadec: Check avpriv_new_chapter() for failure

Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/matroskadec.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index dbec9ee..31ee456 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2161,8 +2161,10 @@ static int matroska_read_header(AVFormatContext *s)
                                    (AVRational) { 1, 1000000000 },
                                    chapters[i].start, chapters[i].end,
                                    chapters[i].title);
-            av_dict_set(&chapters[i].chapter->metadata,
-                        "title", chapters[i].title, 0);
+            if (chapters[i].chapter) {
+                av_dict_set(&chapters[i].chapter->metadata,
+                            "title", chapters[i].title, 0);
+            }
             max_start = chapters[i].start;
         }
 



More information about the ffmpeg-cvslog mailing list