History

demux_edl: fix infinite loop on empty EDL files

"file" is implicit key, it is always available, so we have to check if it is not empty. Found by OSS-Fuzz.

Kacper Michajłow committed 2 years ago

Commit c194f2d1 parent 71d3f411 file · +4 −4Browse files

Unified · Split

demux/demux_edl.c+4−4
@@ -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)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t