Fixes infinite recursion. Trying to extract dirname from string of memory://<data> is not really a good idea. Found by OSS-Fuzz.
Unified · Split
| @@ -567,8 +567,13 @@ error: · 566 unmodified lines | |||
| 567 | 567 | ||
| 568 | static void fix_filenames(struct tl_parts *parts, char *source_path) | 568 | static 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]; |