summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2011-10-12 12:11:18 -0300
committerJohan Hedberg <johan.hedberg@intel.com>2011-10-13 13:08:58 +0300
commit28b3057757862d7ed193341c2640be54deaf3ed0 (patch)
tree8ed6ce4a7a05c1e3b300875b71f84832a71d1d23 /audio
parentc684389188ba4e176019e863d5ea948c0039fa5e (diff)
downloadbluez-28b3057757862d7ed193341c2640be54deaf3ed0.tar.gz
AVRCP: Return error for invalid metadata IDs
Diffstat (limited to 'audio')
-rw-r--r--audio/avrcp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/audio/avrcp.c b/audio/avrcp.c
index a7987fb73..0ca91a554 100644
--- a/audio/avrcp.c
+++ b/audio/avrcp.c
@@ -427,6 +427,10 @@ static int player_get_media_attribute(struct avrcp_player *player,
DBG("Get media attribute: %u", id);
+ if (id == AVRCP_MEDIA_ATTRIBUTE_ILLEGAL ||
+ id > AVRCP_MEDIA_ATTRIBUTE_LAST)
+ return -ENOENT;
+
value = player->cb->get_metadata(id, player->user_data);
if (value == NULL) {
len = 0;
@@ -452,8 +456,6 @@ static int player_get_media_attribute(struct avrcp_player *player,
return -ENOBUFS;
memcpy(elem->val, valstr, len);
break;
- default:
- return -ENOENT;
}
done: