aboutsummaryrefslogtreecommitdiffstats
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-14 03:26:34 +0200
commit59d98fc05078b7cb89b871dba84fce01c4e31067 (patch)
tree428057bbf655ddc080bb4d62fbe6491c5c86e3a6 /libavformat
parent60bfa9154d0084bc8b007b984051a6bb82d9652c (diff)
downloadffmpeg-59d98fc05078b7cb89b871dba84fce01c4e31067.tar.gz
avformat/matroskadec: Check avpriv_new_chapter() for failure
Fixes null pointer dereference Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 87dc8b3af9135f0cfcdf3c0520e3f29e7b0d92c6) 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 ec43526727..fdfba57d92 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;
}