comparison finch/gntsound.c @ 30247:a87764155fa5

Fix a crash in Finch < 2.7.0 with purple >= 2.7.0. The crash would happen if purple_sound_play_event is called for GOT_ATTENTION event. Finch itself doesn't do it, but a plugin might.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 05 Jul 2010 15:49:57 +0000
parents d6dff41a6d4c
children 9bd9ef37354f
comparison
equal deleted inserted replaced
30246:3fdb8ef0fec7 30247:a87764155fa5
575 char *enable_pref; 575 char *enable_pref;
576 char *file_pref; 576 char *file_pref;
577 if ((event == PURPLE_SOUND_BUDDY_ARRIVE) && mute_login_sounds) 577 if ((event == PURPLE_SOUND_BUDDY_ARRIVE) && mute_login_sounds)
578 return; 578 return;
579 579
580 if (event >= PURPLE_NUM_SOUNDS) { 580 if (event >= PURPLE_NUM_SOUNDS ||
581 event >= G_N_ELEMENTS(sounds)) {
581 purple_debug_error("sound", "got request for unknown sound: %d\n", event); 582 purple_debug_error("sound", "got request for unknown sound: %d\n", event);
582 return; 583 return;
583 } 584 }
584 585
585 enable_pref = g_strdup_printf(FINCH_PREFS_ROOT "/sound/profiles/%s/enabled/%s", 586 enable_pref = g_strdup_printf(FINCH_PREFS_ROOT "/sound/profiles/%s/enabled/%s",