You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avformat/utils: Use av_memdup to duplicate array of AVChapter *
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -3176,12 +3176,9 @@ static int compute_chapters_end(AVFormatContext *s)
|
|||||||
max_time = s->duration +
|
max_time = s->duration +
|
||||||
((s->start_time == AV_NOPTS_VALUE) ? 0 : s->start_time);
|
((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)
|
if (!timetable)
|
||||||
return AVERROR(ENOMEM);
|
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);
|
qsort(timetable, s->nb_chapters, sizeof(*timetable), chapter_start_cmp);
|
||||||
|
|
||||||
for (i = 0; i < s->nb_chapters; i++)
|
for (i = 0; i < s->nb_chapters; i++)
|
||||||
|
Reference in New Issue
Block a user