From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> If endpoint respond with an error the callback will be called with size set to -1 not 0. --- profiles/audio/a2dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c index d0676b577..74ada3bbe 100644 --- a/profiles/audio/a2dp.c +++ b/profiles/audio/a2dp.c @@ -2418,7 +2418,7 @@ static void select_cb(struct a2dp_setup *setup, void *ret, int size) struct avdtp_media_codec_capability *codec; int err; - if (size) { + if (size >= 0) { caps_add_codec(&setup->caps, setup->sep->codec, ret, size); goto done; } -- 2.20.1