mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: gracefully handle NULL params
This commit is contained in:
parent
1f2cb7ac67
commit
9e09461113
1 changed files with 7 additions and 1 deletions
|
|
@ -609,7 +609,10 @@ static int impl_set_param(void *object,
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
bool save = false;
|
bool save = false;
|
||||||
|
|
||||||
if ((res = spa_pod_parse_object(param,
|
if (param == NULL) {
|
||||||
|
id = acp_card_find_best_profile_index(this->card, NULL);
|
||||||
|
save = true;
|
||||||
|
} else if ((res = spa_pod_parse_object(param,
|
||||||
SPA_TYPE_OBJECT_ParamProfile, NULL,
|
SPA_TYPE_OBJECT_ParamProfile, NULL,
|
||||||
SPA_PARAM_PROFILE_index, SPA_POD_Int(&id),
|
SPA_PARAM_PROFILE_index, SPA_POD_Int(&id),
|
||||||
SPA_PARAM_PROFILE_save, SPA_POD_OPT_Bool(&save))) < 0) {
|
SPA_PARAM_PROFILE_save, SPA_POD_OPT_Bool(&save))) < 0) {
|
||||||
|
|
@ -629,6 +632,9 @@ static int impl_set_param(void *object,
|
||||||
struct acp_device *dev;
|
struct acp_device *dev;
|
||||||
bool save = false;
|
bool save = false;
|
||||||
|
|
||||||
|
if (param == NULL)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
if ((res = spa_pod_parse_object(param,
|
if ((res = spa_pod_parse_object(param,
|
||||||
SPA_TYPE_OBJECT_ParamRoute, NULL,
|
SPA_TYPE_OBJECT_ParamRoute, NULL,
|
||||||
SPA_PARAM_ROUTE_index, SPA_POD_Int(&id),
|
SPA_PARAM_ROUTE_index, SPA_POD_Int(&id),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue