diff options
Diffstat (limited to 'demux/demux_edl.c')
-rw-r--r-- | demux/demux_edl.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/demux/demux_edl.c b/demux/demux_edl.c index 55af553661..7f7dde2c84 100644 --- a/demux/demux_edl.c +++ b/demux/demux_edl.c @@ -289,6 +289,10 @@ static struct tl_root *parse_edl(bstr str, struct mp_log *log) } else { struct tl_part p = { .length = -1 }; p.filename = get_param0(&ctx, tl, "file"); + if (!p.filename || !p.filename[0]) { + mp_err(log, "Missing filename in segment.'\n"); + goto error; + } p.offset_set = get_param_time(&ctx, "start", &p.offset); get_param_time(&ctx, "length", &p.length); bstr ts = get_param(&ctx, "timestamps"); @@ -306,10 +310,6 @@ static struct tl_root *parse_edl(bstr str, struct mp_log *log) mp_warn(log, "Unknown layout param: '%.*s'\n", BSTR_P(layout)); } } - if (!p.filename) { - mp_err(log, "Missing filename in segment.'\n"); - goto error; - } MP_TARRAY_APPEND(tl, tl->parts, tl->num_parts, p); } if (ctx.error) @@ -451,6 +451,10 @@ static struct timeline_par *build_timeline(struct timeline *root, struct tl_part *part = &parts->parts[n]; struct demuxer *source = NULL; + if (!bstrcasecmp0(mp_split_proto(bstr0(part->filename), NULL), "edl")) { + MP_ERR(root, "Nested EDL is not allowed.\n"); + goto error; + } if (tl->dash) { part->offset = starttime; if (part->length <= 0) @@ -567,8 +571,13 @@ error: static void fix_filenames(struct tl_parts *parts, char *source_path) { - if (!bstrcasecmp0(mp_split_proto(bstr0(source_path), NULL), "edl")) + bstr proto = mp_split_proto(bstr0(source_path), NULL); + // Don't adjust self-expanding protocols + if (!bstrcasecmp0(proto, "memory") || !bstrcasecmp0(proto, "lavf") || + !bstrcasecmp0(proto, "hex") || !bstrcasecmp0(proto, "edl")) + { return; + } struct bstr dirname = mp_dirname(source_path); for (int n = 0; n < parts->num_parts; n++) { struct tl_part *part = &parts->parts[n]; |