summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-12 13:20:56 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-01-25 17:00:08 +0900
commit1a3a52ea25ded1403eb82b38c7d8fa8c799b79c7 (patch)
treecf51c155ef1f983c703316c6d72e740dc00ee42f /player
parent77d5aa56b3a9e10f324c558dda76f4b28137310b (diff)
downloadmpv-1a3a52ea25ded1403eb82b38c7d8fa8c799b79c7.tar.bz2
mpv-1a3a52ea25ded1403eb82b38c7d8fa8c799b79c7.tar.xz
tl_matroska: fix minor memory leak in error case
Going the way of least resistance. Fixes #1460.
Diffstat (limited to 'player')
-rw-r--r--player/timeline/tl_matroska.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/player/timeline/tl_matroska.c b/player/timeline/tl_matroska.c
index 0242623037..e2215864d9 100644
--- a/player/timeline/tl_matroska.c
+++ b/player/timeline/tl_matroska.c
@@ -580,11 +580,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 = {