diff options
author | Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> | 2015-04-28 20:57:59 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-04-28 22:34:31 +0200 |
commit | 84981c8a87a34c542fbff342c33226dd106e9ed0 (patch) | |
tree | f5fad5f8c0a726e28bd430f4bea2eedf1b4062d3 /libavformat | |
parent | ac323fa46330756b60ff4338954de389d268a8fb (diff) | |
download | ffmpeg-84981c8a87a34c542fbff342c33226dd106e9ed0.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: Michael Niedermayer <michaelni@gmx.at>
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 75149693c5..f6fe203671 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -491,6 +491,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]; |