mirror of
https://github.com/mpv-player/mpv
synced 2024-12-25 16:33:02 +00:00
m_property: avoid using a small stack buffer in m_property_do_bstr
This allows operations on properties with longer names (e.g. deeply-nested user-data sub-props).
This commit is contained in:
parent
2d4a243810
commit
2e0bdbfe9c
@ -239,11 +239,10 @@ static void m_property_unkey(int *action, void **arg)
|
||||
static int m_property_do_bstr(const struct m_property *prop_list, bstr name,
|
||||
int action, void *arg, void *ctx)
|
||||
{
|
||||
char name0[64];
|
||||
if (name.len >= sizeof(name0))
|
||||
return M_PROPERTY_UNKNOWN;
|
||||
snprintf(name0, sizeof(name0), "%.*s", BSTR_P(name));
|
||||
return m_property_do(NULL, prop_list, name0, action, arg, ctx);
|
||||
char *name0 = bstrdup0(NULL, name);
|
||||
int ret = m_property_do(NULL, prop_list, name0, action, arg, ctx);
|
||||
talloc_free(name0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void append_str(char **s, int *len, bstr append)
|
||||
|
Loading…
Reference in New Issue
Block a user