aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2009-01-07 00:50:08 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-07 00:50:08 +0800
commit542d9fc9c63dab14081354c889a3d83cb942fc8c (patch)
tree5e043919d0bc10460be69a20767f5cb51007c25a /libempathy-gtk
parent58333aa17a923a435943bd09acefb44e0a13471e (diff)
downloadgsoc2013-empathy-542d9fc9c63dab14081354c889a3d83cb942fc8c.tar
gsoc2013-empathy-542d9fc9c63dab14081354c889a3d83cb942fc8c.tar.gz
gsoc2013-empathy-542d9fc9c63dab14081354c889a3d83cb942fc8c.tar.bz2
gsoc2013-empathy-542d9fc9c63dab14081354c889a3d83cb942fc8c.tar.lz
gsoc2013-empathy-542d9fc9c63dab14081354c889a3d83cb942fc8c.tar.xz
gsoc2013-empathy-542d9fc9c63dab14081354c889a3d83cb942fc8c.tar.zst
gsoc2013-empathy-542d9fc9c63dab14081354c889a3d83cb942fc8c.zip
Assert that sound_id is OK before getting sound_entries[sound_id], to avoid crash.
svn path=/trunk/; revision=2103
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-ui-utils.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 5f36b4b7e..474148a68 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -1563,10 +1563,12 @@ void
empathy_sound_play (GtkWidget *widget,
EmpathySound sound_id)
{
- EmpathySoundEntry *entry = &(sound_entries[sound_id]);
+ EmpathySoundEntry *entry;
gboolean should_play = TRUE;
- g_return_if_fail (entry->sound_id < LAST_EMPATHY_SOUND);
+ g_return_if_fail (sound_id < LAST_EMPATHY_SOUND);
+
+ entry = &(sound_entries[sound_id]);
g_return_if_fail (entry->sound_id == sound_id);
if (entry->gconf_key != NULL) {
@@ -1583,4 +1585,4 @@ empathy_sound_play (GtkWidget *widget,
CA_PROP_EVENT_DESCRIPTION, gettext (entry->event_ca_description),
NULL);
}
-} \ No newline at end of file
+}