From 5eb47745978925e451523c8e8cb2ad6a53ed3863 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 21 Jan 2016 17:38:02 +0200 Subject: audio/avrcp: Don't print an error if folder length is 0 Some stacks, for instance iOS, does actually send 0 as folder length so just ignore if that happens since that means only means the folder doesn't have a name. --- profiles/audio/avrcp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c index 0c3a761b2..638272150 100644 --- a/profiles/audio/avrcp.c +++ b/profiles/audio/avrcp.c @@ -2656,8 +2656,10 @@ static gboolean avrcp_set_browsed_player_rsp(struct avctp *conn, uint8_t len; len = pdu->params[i++]; + if (!len) + continue; - if (i + len > operand_count || len == 0) { + if (i + len > operand_count) { error("Invalid folder length"); break; } -- cgit v1.2.1