]> git.0d.be Git - empathy.git/commitdiff
Assert that sound_id is OK before getting sound_entries[sound_id], to avoid crash.
authorXavier Claessens <xclaesse@src.gnome.org>
Tue, 6 Jan 2009 16:50:08 +0000 (16:50 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Tue, 6 Jan 2009 16:50:08 +0000 (16:50 +0000)
svn path=/trunk/; revision=2103

libempathy-gtk/empathy-ui-utils.c

index 5f36b4b7e16f7c5726d58827e66dc5e31410157d..474148a68961121b249840f1c438b9c41e0885ae 100644 (file)
@@ -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
+}