diff options
author | wm4 <wm4@nowhere> | 2015-01-12 13:20:56 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-01-12 13:20:56 +0100 |
commit | fcdbaf78f23f57f6c493efa9ec1689696db9a2d1 (patch) | |
tree | 9335212831af1005f7ef5702c4c3266cef4f19e2 /player | |
parent | 8336563d237a2fe78bafda9e8690e812f28fa5aa (diff) |
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.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 = { |