endpoint: handle NULL name and media_class

This commit is contained in:
Wim Taymans 2019-11-26 17:52:27 +01:00
parent 2fddfb02bd
commit 8e24e57db0

View file

@ -68,6 +68,8 @@ static int endpoint_enum_params (void *object, int seq,
uint32_t next = start; uint32_t next = start;
uint32_t count = 0; uint32_t count = 0;
pw_log_debug(NAME" %p: param %u %d/%d", this, id, start, num);
while (true) { while (true) {
index = next++; index = next++;
if (index >= this->n_params) if (index >= this->n_params)
@ -224,8 +226,8 @@ int endpoint_update(struct endpoint *this,
} }
if (!this->info.name) { if (!this->info.name) {
this->info.name = strdup(info->name); this->info.name = info->name ? strdup(info->name) : NULL;
this->info.media_class = strdup(info->media_class); this->info.media_class = info->media_class ? strdup(info->media_class) : NULL;
this->info.direction = info->direction; this->info.direction = info->direction;
this->info.flags = info->flags; this->info.flags = info->flags;
} }