mirror of
https://github.com/mpv-player/mpv
synced 2025-03-19 09:57:34 +00:00
demux_mf: early exit with the '%%' case
This commit is contained in:
parent
f88ed14168
commit
034eeaa8d7
@ -158,18 +158,30 @@ static mf_t *open_mf_pattern(void *talloc_ctx, struct demuxer *d, char *filename
|
|||||||
while (nspec < 2 && (c = *f++)) {
|
while (nspec < 2 && (c = *f++)) {
|
||||||
if (c != '%')
|
if (c != '%')
|
||||||
continue;
|
continue;
|
||||||
if (*f != '%') {
|
|
||||||
nspec++; // conversion specifier which isn't %%
|
if (*f == '%') {
|
||||||
if (*f == '.')
|
// '%%', which ends up as an explicit % in the output.
|
||||||
f++;
|
// Skipping forwards as it doesn't require further attention.
|
||||||
for (int ndig = 0; mp_isdigit(*f) && ndig < MAXDIGS; ndig++, f++)
|
f++;
|
||||||
/* no-op */;
|
continue;
|
||||||
if (*f != 'd') {
|
|
||||||
bad_spec++; // not int, or beyond our validation capacity
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// *f is '%' or 'd'
|
|
||||||
|
// Now c == '%' and *f != '%', thus we have entered territory of format
|
||||||
|
// specifiers which we are interested in.
|
||||||
|
nspec++;
|
||||||
|
|
||||||
|
if (*f == '.')
|
||||||
|
f++;
|
||||||
|
|
||||||
|
for (int ndig = 0; mp_isdigit(*f) && ndig < MAXDIGS; ndig++, f++)
|
||||||
|
/* no-op */;
|
||||||
|
|
||||||
|
if (*f != 'd') {
|
||||||
|
bad_spec++; // not int, or beyond our validation capacity
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// *f is 'd'
|
||||||
f++;
|
f++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user