[FFmpeg-cvslog] nut: Check chapter creation in decode_info_header
Andreas Cadhalpun
git at videolan.org
Mon Jun 1 13:11:21 CEST 2015
ffmpeg | branch: release/2.2 | Andreas Cadhalpun <andreas.cadhalpun at googlemail.com> | Tue Apr 28 20:57:59 2015 +0200| [3bebca9634f05ea5da7624e3a3f35ec95341e250] | committer: Reinhard Tartler
nut: Check chapter creation in decode_info_header
This fixes a segmentation fault when accessing the metadata.
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
CC: libav-stable at libav.org
(cherry picked from commit 21b21aed797b5e636adcf2df811f96a95f208930)
Signed-off-by: Reinhard Tartler <siretart at tauware.de>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3bebca9634f05ea5da7624e3a3f35ec95341e250
---
libavformat/nutdec.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 6328549..0da7c4b 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -474,6 +474,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];
More information about the ffmpeg-cvslog
mailing list