[FFmpeg-cvslog] nutdec: check chapter creation in decode_info_header

Andreas Cadhalpun git at videolan.org
Tue May 19 21:36:42 CEST 2015


ffmpeg | branch: release/2.4 | Andreas Cadhalpun <andreas.cadhalpun at googlemail.com> | Tue Apr 28 20:57:59 2015 +0200| [63afe5b9140bacdf587cff0cd9427ab03fa76b72] | committer: Michael Niedermayer

nutdec: check chapter creation in decode_info_header

This fixes a segmentation fault when accessing the metadata.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 3ff1af2b0db7132d5717be6395227a94c8abab07)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=63afe5b9140bacdf587cff0cd9427ab03fa76b72
---

 libavformat/nutdec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 11e7e43..7ae722b 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];



More information about the ffmpeg-cvslog mailing list