mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
alsa: don't crash on NULL params
This commit is contained in:
parent
57e732cd27
commit
16f1d6349d
2 changed files with 12 additions and 4 deletions
|
|
@ -353,7 +353,9 @@ static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
|
|||
case SPA_PARAM_ProcessLatency:
|
||||
{
|
||||
struct spa_process_latency_info info;
|
||||
if ((res = spa_process_latency_parse(param, &info)) < 0)
|
||||
if (param == NULL)
|
||||
spa_zero(info);
|
||||
else if ((res = spa_process_latency_parse(param, &info)) < 0)
|
||||
return res;
|
||||
|
||||
handle_process_latency(this, &info);
|
||||
|
|
@ -694,7 +696,9 @@ impl_node_port_set_param(void *object,
|
|||
case SPA_PARAM_Latency:
|
||||
{
|
||||
struct spa_latency_info info;
|
||||
if ((res = spa_latency_parse(param, &info)) < 0)
|
||||
if (param == NULL)
|
||||
info = SPA_LATENCY_INFO(SPA_DIRECTION_REVERSE(direction));
|
||||
else if ((res = spa_latency_parse(param, &info)) < 0)
|
||||
return res;
|
||||
if (direction == info.direction)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -319,7 +319,9 @@ static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
|
|||
case SPA_PARAM_ProcessLatency:
|
||||
{
|
||||
struct spa_process_latency_info info;
|
||||
if ((res = spa_process_latency_parse(param, &info)) < 0)
|
||||
if (param == NULL)
|
||||
spa_zero(info);
|
||||
else if ((res = spa_process_latency_parse(param, &info)) < 0)
|
||||
return res;
|
||||
|
||||
handle_process_latency(this, &info);
|
||||
|
|
@ -631,7 +633,9 @@ impl_node_port_set_param(void *object,
|
|||
case SPA_PARAM_Latency:
|
||||
{
|
||||
struct spa_latency_info info;
|
||||
if ((res = spa_latency_parse(param, &info)) < 0)
|
||||
if (param == NULL)
|
||||
info = SPA_LATENCY_INFO(SPA_DIRECTION_REVERSE(direction));
|
||||
else if ((res = spa_latency_parse(param, &info)) < 0)
|
||||
return res;
|
||||
if (direction == info.direction)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue