From 7d94e9c52fc7023e7ef7ca036de02b6131ecc376 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 1 Jan 2014 07:33:48 -0800 Subject: Don't allow soundfonts with existing presets in alLoadSoundfontSOFT --- OpenAL32/alMidi.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenAL32') diff --git a/OpenAL32/alMidi.c b/OpenAL32/alMidi.c index 17384bcf..3bf0acc4 100644 --- a/OpenAL32/alMidi.c +++ b/OpenAL32/alMidi.c @@ -86,6 +86,11 @@ AL_API void AL_APIENTRY alLoadSoundfontSOFT(ALuint id, size_t(*cb)(ALvoid*,size_ WriteUnlock(&sfont->Lock); SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done); } + if(sfont->NumPresets > 0) + { + WriteUnlock(&sfont->Lock); + SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done); + } reader.cb = cb; reader.ptr = user; -- cgit v1.2.3