diff options
author | Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> | 2015-04-28 20:57:59 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2015-05-08 11:10:51 +0200 |
commit | b34257eefd98cb768ea2f53a390b8684d51e689a (patch) | |
tree | 9b8716289ec6fea18f80590802285de5710acfff | |
parent | 243e8443cd9e83c887e3f5edf09a169e7783d14e (diff) | |
download | ffmpeg-streaming-b34257eefd98cb768ea2f53a390b8684d51e689a.zip ffmpeg-streaming-b34257eefd98cb768ea2f53a390b8684d51e689a.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
-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 71eaba4..ed28107 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -487,6 +487,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]; |