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
289289 } else {
290290 struct tl_part p = { .length = -1 };
291291 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+ }
292296 p.offset_set = get_param_time(&ctx, "start", &p.offset);
293297 get_param_time(&ctx, "length", &p.length);
294298 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
306310 mp_warn(log, "Unknown layout param: '%.*s'\n", BSTR_P(layout));
307311 }
308312 }
309− if (!p.filename) {
310− mp_err(log, "Missing filename in segment.'\n");
311− goto error;
312− }
313313 MP_TARRAY_APPEND(tl, tl->parts, tl->num_parts, p);
314314 }
315315 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