Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com> --- libavformat/utils.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/libavformat/utils.c b/libavformat/utils.c index b3ff9e95eb..b56190d2da 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3176,12 +3176,9 @@ static int compute_chapters_end(AVFormatContext *s) max_time = s->duration + ((s->start_time == AV_NOPTS_VALUE) ? 0 : s->start_time); - timetable = av_malloc(s->nb_chapters * sizeof(*timetable)); + timetable = av_memdup(s->chapters, s->nb_chapters * sizeof(*timetable)); if (!timetable) return AVERROR(ENOMEM); - - for (i = 0; i < s->nb_chapters; i++) - timetable[i] = s->chapters[i]; qsort(timetable, s->nb_chapters, sizeof(*timetable), chapter_start_cmp); for (i = 0; i < s->nb_chapters; i++) -- 2.30.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".