a2dp: guard against transport NULL

The transport can become NULL so check that and don't try to
deref it.
This commit is contained in:
Wim Taymans 2021-10-11 11:22:36 +02:00
parent 6df8ce3031
commit 594f67ec04
2 changed files with 4 additions and 2 deletions

View file

@ -254,7 +254,8 @@ static int impl_node_enum_params(void *object, int seq,
if (enum_codec) { if (enum_codec) {
int res; int res;
if (this->codec->enum_props == NULL || this->codec_props == NULL) if (this->codec->enum_props == NULL || this->codec_props == NULL ||
this->transport == NULL)
return 0; return 0;
else if ((res = this->codec->enum_props(this->codec_props, else if ((res = this->codec->enum_props(this->codec_props,
this->transport->device->settings, this->transport->device->settings,

View file

@ -239,7 +239,8 @@ static int impl_node_enum_params(void *object, int seq,
if (enum_codec) { if (enum_codec) {
int res; int res;
if (this->codec->enum_props == NULL || this->codec_props == NULL) if (this->codec->enum_props == NULL || this->codec_props == NULL ||
this->transport == NULL)
return 0; return 0;
else if ((res = this->codec->enum_props(this->codec_props, else if ((res = this->codec->enum_props(this->codec_props,
this->transport->device->settings, this->transport->device->settings,