Browse Source

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 3ff1af2b0d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.4.10
Andreas Cadhalpun Michael Niedermayer 10 years ago
parent
commit
63afe5b914
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavformat/nutdec.c

+ 4
- 0
libavformat/nutdec.c View File

@@ -505,6 +505,10 @@ static int decode_info_header(NUTContext *nut)
nut->time_base[chapter_start % nut->time_base[chapter_start %
nut->time_base_count], nut->time_base_count],
start, start + chapter_len, NULL); start, start + chapter_len, NULL);
if (!chapter) {
av_log(s, AV_LOG_ERROR, "could not create chapter\n");
return AVERROR(ENOMEM);
}
metadata = &chapter->metadata; metadata = &chapter->metadata;
} else if (stream_id_plus1) { } else if (stream_id_plus1) {
st = s->streams[stream_id_plus1 - 1]; st = s->streams[stream_id_plus1 - 1];


Loading…
Cancel
Save