diff options
author | Chris Robinson <[email protected]> | 2013-12-29 04:25:28 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-12-29 04:25:28 -0800 |
commit | 15aa12847d7d2797d5ef37ae428d5ab9afe0753a (patch) | |
tree | 902f3fc05cb700a116052c07bbb87a4b47a381a2 /Alc/midi/fluidsynth.c | |
parent | 699d84491f2f01a95b8210ba7234dcebc8b4f817 (diff) |
Check for negative soundfont indices getting passed to the loader
Diffstat (limited to 'Alc/midi/fluidsynth.c')
-rw-r--r-- | Alc/midi/fluidsynth.c | 2 |
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; |