diff --git a/src/classic/avdtp.c b/src/classic/avdtp.c index 96b377b5f..a68ab4472 100644 --- a/src/classic/avdtp.c +++ b/src/classic/avdtp.c @@ -510,8 +510,12 @@ uint8_t avdtp_validate_media_configuration(const avdtp_stream_endpoint_t *stream return 0; } uint8_t event[AVDTP_MEDIA_CONFIG_OTHER_EVENT_LEN]; + uint16_t size = 0; - avdtp_setup_media_codec_config_event(event, sizeof(event), stream_endpoint, avdtp_cid, reconfigure, media_codec, &size); + uint8_t status = avdtp_setup_media_codec_config_event(event, sizeof(event), stream_endpoint, avdtp_cid, reconfigure, media_codec, &size); + if (status != ERROR_CODE_SUCCESS){ + return status; + } return (*callback)(stream_endpoint, event, size); } diff --git a/src/classic/avdtp_acceptor.c b/src/classic/avdtp_acceptor.c index f86a2c431..a4219140a 100644 --- a/src/classic/avdtp_acceptor.c +++ b/src/classic/avdtp_acceptor.c @@ -122,7 +122,7 @@ avdtp_acceptor_handle_configuration_command(avdtp_connection_t *connection, int if ((sep.configured_service_categories & (1 << AVDTP_MEDIA_CODEC)) != 0){ const adtvp_media_codec_capabilities_t * media = &sep.configuration.media_codec; uint8_t error_code = avdtp_validate_media_configuration(stream_endpoint, connection->avdtp_cid, 0, media); - if (error_code != 0){ + if (error_code != ERROR_CODE_SUCCESS){ log_info("media codec rejected by validator, error 0x%02x", error_code); connection->reject_service_category = AVDTP_MEDIA_CODEC; connection->error_code = error_code;