History

demux_edl: don't try to extract dirname from self-expanding protocols

Fixes infinite recursion. Trying to extract dirname from string of memory://<data> is not really a good idea. Found by OSS-Fuzz.

Kacper Michajłow committed 2 years ago

Commit 66fdec81 parent 14571f01 file · +6 −1Browse files

Unified · Split

demux/demux_edl.c+6−1
@@ -567,8 +567,13 @@ error: · 566 unmodified lines
567 567
568static void fix_filenames(struct tl_parts *parts, char *source_path)568static void fix_filenames(struct tl_parts *parts, char *source_path)
569{569{
570 if (!bstrcasecmp0(mp_split_proto(bstr0(source_path), NULL), "edl"))570 bstr proto = mp_split_proto(bstr0(source_path), NULL);
571 // Don't adjust self-expanding protocols
572 if (!bstrcasecmp0(proto, "memory") || !bstrcasecmp0(proto, "lavf") ||
573 !bstrcasecmp0(proto, "hex") || !bstrcasecmp0(proto, "edl"))
574 {
571 return;575 return;
576 }
572 struct bstr dirname = mp_dirname(source_path);577 struct bstr dirname = mp_dirname(source_path);
573 for (int n = 0; n < parts->num_parts; n++) {578 for (int n = 0; n < parts->num_parts; n++) {
574 struct tl_part *part = &parts->parts[n];579 struct tl_part *part = &parts->parts[n];

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