diff options
author | Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> | 2015-04-28 20:57:59 +0200 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-05-14 19:08:02 +0200 |
commit | 9b87d15ca80cfa831a2b5551dfc02ae81f4f1a8c (patch) | |
tree | a7476fa62506e033bce23a9c6ed15123458e8f30 | |
parent | a13a288ec810027f0c1f23bb1385a85d3c554db5 (diff) | |
download | ffmpeg-9b87d15ca80cfa831a2b5551dfc02ae81f4f1a8c.tar.gz |
nutdec: check chapter creation in decode_info_header
This fixes a segmentation fault when accessing the metadata.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3ff1af2b0db7132d5717be6395227a94c8abab07)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r-- | libavformat/nutdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 65d799ee5d..d0c5635ca0 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -505,6 +505,10 @@ static int decode_info_header(NUTContext *nut) nut->time_base[chapter_start % nut->time_base_count], start, start + chapter_len, NULL); + if (!chapter) { + av_log(s, AV_LOG_ERROR, "could not create chapter\n"); + return AVERROR(ENOMEM); + } metadata = &chapter->metadata; } else if (stream_id_plus1) { st = s->streams[stream_id_plus1 - 1]; |