Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/4] audio/player: Fix using invalid end index
@ 2014-01-30 23:03 Luiz Augusto von Dentz
  2014-01-30 23:03 ` [PATCH BlueZ 2/4] audio/AVRCP: Fix using the wrong octet for folder type Luiz Augusto von Dentz
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2014-01-30 23:03 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

When the End index is not set in ListItems the code automatically pick
the number of items as end index but the start index start with 0 so
the correct is to use number of items - 1.
---
 profiles/audio/player.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/profiles/audio/player.c b/profiles/audio/player.c
index e6d24eb..2bd2d6e 100644
--- a/profiles/audio/player.c
+++ b/profiles/audio/player.c
@@ -808,7 +808,8 @@ static int parse_filters(struct media_player *player, DBusMessageIter *iter,
 	int ctype;
 
 	*start = 0;
-	*end = folder->number_of_items ? folder->number_of_items : UINT32_MAX;
+	*end = folder->number_of_items ? folder->number_of_items - 1 :
+								UINT32_MAX;
 
 	ctype = dbus_message_iter_get_arg_type(iter);
 	if (ctype != DBUS_TYPE_ARRAY)
-- 
1.8.4.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-02-02 15:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-30 23:03 [PATCH BlueZ 1/4] audio/player: Fix using invalid end index Luiz Augusto von Dentz
2014-01-30 23:03 ` [PATCH BlueZ 2/4] audio/AVRCP: Fix using the wrong octet for folder type Luiz Augusto von Dentz
2014-01-30 23:03 ` [PATCH BlueZ 3/4] audio/AVRCP: Fix not setting playable flag for folder Luiz Augusto von Dentz
2014-01-30 23:03 ` [PATCH BlueZ 4/4] audio/AVRCP: Fix coding style Luiz Augusto von Dentz
2014-01-31  7:55   ` Andrei Emeltchenko
2014-01-31 17:14     ` Luiz Augusto von Dentz
2014-02-02 15:40 ` [PATCH BlueZ 1/4] audio/player: Fix using invalid end index Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox