mirror of
https://github.com/mpv-player/mpv
synced 2024-11-14 22:48:35 +01:00
ao: fix potential NULL deref in ao_device_list_add()
Probably didn't happen in practice, but anyway. Found by coverity.
This commit is contained in:
parent
64b1a656c7
commit
06619f53a8
@ -605,8 +605,8 @@ void ao_device_list_add(struct ao_device_list *list, struct ao *ao,
|
||||
c.desc = "Default";
|
||||
}
|
||||
}
|
||||
c.name = c.name[0] ? talloc_asprintf(list, "%s/%s", dname, c.name)
|
||||
: talloc_strdup(list, dname);
|
||||
c.name = (c.name && c.name[0]) ? talloc_asprintf(list, "%s/%s", dname, c.name)
|
||||
: talloc_strdup(list, dname);
|
||||
c.desc = talloc_strdup(list, c.desc);
|
||||
MP_TARRAY_APPEND(list, list->devices, list->num_devices, c);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user