Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>2015-04-28 21:57:59 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-04-28 23:22:48 +0300
commit3ff1af2b0db7132d5717be6395227a94c8abab07 (patch)
treef9462d090ea4f2a33b737b21221d4c328720f7b5 /libavformat/nutdec.c
parent6621105877ce0d65724a8ab60b3a50160adbe65d (diff)
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>
Diffstat (limited to 'libavformat/nutdec.c')
-rw-r--r--libavformat/nutdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 1bb2091e49..5073b45a92 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];