From 9c05a16c5b01f2b6b14ec46924798a1b7593eeb0 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 30 Jan 2014 14:14:49 -0800 Subject: [PATCH] audio/player: Fix using invalid end index 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 e6d24eb57..2bd2d6e49 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) -- 2.47.3