summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>2015-04-28 20:57:59 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-10 02:13:10 +0200
commit0691554e68e36833586f5d5a9ada0f7cdbf88fb2 (patch)
tree4ae9d6a194deda2759489ff9106714ea905664d1
parent7f2b3c3bee6f6ca57d7074cf272685c2c0e3f03c (diff)
downloadffmpeg-0691554e68e36833586f5d5a9ada0f7cdbf88fb2.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>
-rw-r--r--libavformat/nutdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 3eb6d4b703..202d84c250 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];