From b22f56e88a9fb5ddec1ea7dece4c03746744b3a5 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 3 May 2019 10:51:34 +0300 Subject: [PATCH] a2dp: Fix crash when endpoint respond with an error 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.47.3