diff options
author | Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> | 2015-04-28 20:57:59 +0200 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-05-19 12:14:39 +0100 |
commit | 21b21aed797b5e636adcf2df811f96a95f208930 (patch) | |
tree | f8e39ba8c8d26265090df3f6e75751f3344948e6 /libavformat | |
parent | cb5324200ccdc693dd5b28dcd7d4b722fad83ea2 (diff) | |
download | ffmpeg-21b21aed797b5e636adcf2df811f96a95f208930.tar.gz |
nut: Check chapter creation in decode_info_header
This fixes a segmentation fault when accessing the metadata.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
CC: libav-stable@libav.org
Diffstat (limited to 'libavformat')
-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 36ca754fa1..116c3d4e13 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -482,6 +482,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]; |