diff options
-rw-r--r-- | player/timeline/tl_matroska.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/player/timeline/tl_matroska.c b/player/timeline/tl_matroska.c index f303a6fabb..ae13f1973c 100644 --- a/player/timeline/tl_matroska.c +++ b/player/timeline/tl_matroska.c @@ -541,11 +541,13 @@ void build_ordered_chapter_timeline(struct MPContext *mpctx) } if (!part_count) { - // None of the parts come from the file itself??? - talloc_free(sources); - talloc_free(timeline); - talloc_free(chapters); - return; + // None of the parts come from the file itself??? + // Broken file, but we need at least 1 valid timeline part - add a dummy. + MP_WARN(mpctx, "Ordered chapters file with no parts?\n"); + struct timeline_part new = { + .source = demuxer, + }; + MP_TARRAY_APPEND(NULL, timeline, part_count, new); } struct timeline_part new = { |