Re: [PATCH 7/7] AVRCP: fix off-by-one in media attribute iteration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lucas,

On Mon, Oct 10, 2011 at 3:37 PM, Lucas De Marchi
<lucas.demarchi@xxxxxxxxxxxxxx> wrote:
> ---
>  audio/avrcp.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/audio/avrcp.c b/audio/avrcp.c
> index 0d9b6d0..3576008 100644
> --- a/audio/avrcp.c
> +++ b/audio/avrcp.c
> @@ -603,7 +603,7 @@ static uint8_t avrcp_handle_get_element_attributes(struct avrcp_player *player,
>        nattr = pdu->params[8];
>
>        if (!nattr) {
> -               for (i = 1; i < AVRCP_MEDIA_ATTRIBUTE_LAST; i++) {
> +               for (i = 1; i <= AVRCP_MEDIA_ATTRIBUTE_LAST; i++) {
>                        size = player_get_media_attribute(player, i,
>                                                        &pdu->params[pos],
>                                                        AVRCP_PDU_MTU - pos);
> --
> 1.7.7

What if we have a new callback to list the available metadata in the
media player and then iterate in that list, this way we don't have to
lookup for everything instead we use g_hash_table_get_keys and just
lookup for existing ones.

-- 
Luiz Augusto von Dentz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux