* [PATCH] Fix GLib assertion failure in media.c get_setting()
@ 2012-02-02 22:21 Szymon Janc
2012-02-02 23:01 ` Luiz Augusto von Dentz
2012-02-02 23:58 ` Johan Hedberg
0 siblings, 2 replies; 3+ messages in thread
From: Szymon Janc @ 2012-02-02 22:21 UTC (permalink / raw)
To: linux-bluetooth; +Cc: szymon.janc
If get_setting is called before set_setting, mp->settings would be
NULL resulting in GLib assertion. Hashmap is now allocated in
media_player_create instead of on-demand allocation in set_setting.
external/bluetooth/bluez/audio/media.c:get_setting() Equalizer
CRITICAL **: g_hash_table_lookup: assertion `hash_table != NULL' failed
---
audio/media.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/audio/media.c b/audio/media.c
index a363b8e..c0fd0c3 100644
--- a/audio/media.c
+++ b/audio/media.c
@@ -1371,9 +1371,6 @@ static gboolean set_property(struct media_player *mp, const char *key,
DBG("%s=%s", key, value);
- if (!mp->settings)
- mp->settings = g_hash_table_new(g_direct_hash, g_direct_equal);
-
g_hash_table_replace(mp->settings, GUINT_TO_POINTER(attr),
GUINT_TO_POINTER(val));
@@ -1595,6 +1592,8 @@ static struct media_player *media_player_create(struct media_adapter *adapter,
return NULL;
}
+ mp->settings = g_hash_table_new(g_direct_hash, g_direct_equal);
+
adapter->players = g_slist_append(adapter->players, mp);
info("Player registered: sender=%s path=%s", sender, path);
--
on behalf of ST-Ericsson
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix GLib assertion failure in media.c get_setting()
2012-02-02 22:21 [PATCH] Fix GLib assertion failure in media.c get_setting() Szymon Janc
@ 2012-02-02 23:01 ` Luiz Augusto von Dentz
2012-02-02 23:58 ` Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2012-02-02 23:01 UTC (permalink / raw)
To: Szymon Janc; +Cc: linux-bluetooth
Hi Szymon,
On Thu, Feb 2, 2012 at 2:21 PM, Szymon Janc <szymon.janc@tieto.com> wrote:
> If get_setting is called before set_setting, mp->settings would be
> NULL resulting in GLib assertion. Hashmap is now allocated in
> media_player_create instead of on-demand allocation in set_setting.
>
> external/bluetooth/bluez/audio/media.c:get_setting() Equalizer
> CRITICAL **: g_hash_table_lookup: assertion `hash_table != NULL' failed
> ---
> audio/media.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/audio/media.c b/audio/media.c
> index a363b8e..c0fd0c3 100644
> --- a/audio/media.c
> +++ b/audio/media.c
> @@ -1371,9 +1371,6 @@ static gboolean set_property(struct media_player *mp, const char *key,
>
> DBG("%s=%s", key, value);
>
> - if (!mp->settings)
> - mp->settings = g_hash_table_new(g_direct_hash, g_direct_equal);
> -
> g_hash_table_replace(mp->settings, GUINT_TO_POINTER(attr),
> GUINT_TO_POINTER(val));
>
> @@ -1595,6 +1592,8 @@ static struct media_player *media_player_create(struct media_adapter *adapter,
> return NULL;
> }
>
> + mp->settings = g_hash_table_new(g_direct_hash, g_direct_equal);
> +
> adapter->players = g_slist_append(adapter->players, mp);
>
> info("Player registered: sender=%s path=%s", sender, path);
> --
> on behalf of ST-Ericsson
Ack,
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix GLib assertion failure in media.c get_setting()
2012-02-02 22:21 [PATCH] Fix GLib assertion failure in media.c get_setting() Szymon Janc
2012-02-02 23:01 ` Luiz Augusto von Dentz
@ 2012-02-02 23:58 ` Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2012-02-02 23:58 UTC (permalink / raw)
To: Szymon Janc; +Cc: linux-bluetooth
Hi Szymon,
On Thu, Feb 02, 2012, Szymon Janc wrote:
> If get_setting is called before set_setting, mp->settings would be
> NULL resulting in GLib assertion. Hashmap is now allocated in
> media_player_create instead of on-demand allocation in set_setting.
>
> external/bluetooth/bluez/audio/media.c:get_setting() Equalizer
> CRITICAL **: g_hash_table_lookup: assertion `hash_table != NULL' failed
> ---
> audio/media.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
Applied. Thanks.
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-02-02 23:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-02 22:21 [PATCH] Fix GLib assertion failure in media.c get_setting() Szymon Janc
2012-02-02 23:01 ` Luiz Augusto von Dentz
2012-02-02 23:58 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).