OSDN Git Service
(root)
/
android-x86
/
external-bluetooth-bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c684389
)
AVRCP: Return error for invalid metadata IDs
author
Lucas De Marchi
<lucas.demarchi@profusion.mobi>
Wed, 12 Oct 2011 15:11:18 +0000
(12:11 -0300)
committer
Johan Hedberg
<johan.hedberg@intel.com>
Thu, 13 Oct 2011 10:08:58 +0000
(13:08 +0300)
audio/avrcp.c
patch
|
blob
|
history
diff --git
a/audio/avrcp.c
b/audio/avrcp.c
index
a7987fb
..
0ca91a5
100644
(file)
--- 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: