summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorJustin Jacobs <jajdorkster@gmail.com>2014-08-06 20:04:38 -0400
committerMichael Niedermayer <michaelni@gmx.at>2014-08-08 21:16:30 +0200
commit87dc8b3af9135f0cfcdf3c0520e3f29e7b0d92c6 (patch)
treef523dabd6c427ad5392ba30ec198b224cae03566 /libavformat
parent1ba7c6ead24f1485ad537cfdedb2a6cf5ca8e869 (diff)
avformat/matroskadec: Check avpriv_new_chapter() for failure
Fixes null pointer dereference Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/matroskadec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index dbec9ee18c..31ee4567aa 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;
}