From 15aa12847d7d2797d5ef37ae428d5ab9afe0753a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 29 Dec 2013 04:25:28 -0800 Subject: Check for negative soundfont indices getting passed to the loader --- Alc/midi/fluidsynth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Alc/midi') diff --git a/Alc/midi/fluidsynth.c b/Alc/midi/fluidsynth.c index 3d3338dc..106f538d 100644 --- a/Alc/midi/fluidsynth.c +++ b/Alc/midi/fluidsynth.c @@ -399,7 +399,7 @@ static fluid_sfont_t *FSynth_loadSfont(fluid_sfloader_t *loader, const char *fil if(!filename || sscanf(filename, "_al_internal %d", &idx) != 1) return NULL; - if(idx >= STATIC_CAST(MidiSynth, self)->NumSoundfonts) + if(idx < 0 || idx >= STATIC_CAST(MidiSynth, self)->NumSoundfonts) { ERR("Received invalid soundfont index %d (max: %d)\n", idx, STATIC_CAST(MidiSynth, self)->NumSoundfonts); return NULL; -- cgit v1.2.3