aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-12-29 04:25:28 -0800
committerChris Robinson <[email protected]>2013-12-29 04:25:28 -0800
commit15aa12847d7d2797d5ef37ae428d5ab9afe0753a (patch)
tree902f3fc05cb700a116052c07bbb87a4b47a381a2
parent699d84491f2f01a95b8210ba7234dcebc8b4f817 (diff)
Check for negative soundfont indices getting passed to the loader
-rw-r--r--Alc/midi/fluidsynth.c2
1 files changed, 1 insertions, 1 deletions
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;