Commit 542d9fc9 authored by Xavier Claessens's avatar Xavier Claessens

Assert that sound_id is OK before getting sound_entries[sound_id], to avoid crash.

svn path=/trunk/; revision=2103
parent 58333aa1
......@@ -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
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment