"file" is implicit key, it is always available, so we have to check if it is not empty. Found by OSS-Fuzz.
Unified · Split
| @@ -289,6 +289,10 @@ static struct tl_root *parse_edl(bstr str, struct mp_log *log) · 288 unmodified lines | |||
| 289 | } else { | 289 | } else { |
| 290 | struct tl_part p = { .length = -1 }; | 290 | struct tl_part p = { .length = -1 }; |
| 291 | p.filename = get_param0(&ctx, tl, "file"); | 291 | p.filename = get_param0(&ctx, tl, "file"); |
| 292 | if (!p.filename || !p.filename[0]) { | ||
| 293 | mp_err(log, "Missing filename in segment.'\n"); | ||
| 294 | goto error; | ||
| 295 | } | ||
| 292 | p.offset_set = get_param_time(&ctx, "start", &p.offset); | 296 | p.offset_set = get_param_time(&ctx, "start", &p.offset); |
| 293 | get_param_time(&ctx, "length", &p.length); | 297 | get_param_time(&ctx, "length", &p.length); |
| 294 | bstr ts = get_param(&ctx, "timestamps"); | 298 | bstr ts = get_param(&ctx, "timestamps"); |
| @@ -306,10 +310,6 @@ static struct tl_root *parse_edl(bstr str, struct mp_log *log) · 11 unmodified lines | |||
| 306 | mp_warn(log, "Unknown layout param: '%.*s'\n", BSTR_P(layout)); | 310 | mp_warn(log, "Unknown layout param: '%.*s'\n", BSTR_P(layout)); |
| 307 | } | 311 | } |
| 308 | } | 312 | } |
| 309 | if (!p.filename) { | ||
| 310 | mp_err(log, "Missing filename in segment.'\n"); | ||
| 311 | goto error; | ||
| 312 | } | ||
| 313 | MP_TARRAY_APPEND(tl, tl->parts, tl->num_parts, p); | 313 | MP_TARRAY_APPEND(tl, tl->parts, tl->num_parts, p); |
| 314 | } | 314 | } |
| 315 | if (ctx.error) | 315 | if (ctx.error) |