From 56bb8689d4d4735aa79c71d41a0e87857dbece1c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 1 Jul 2014 19:43:20 -0700 Subject: Fix preset zone instrument header check --- Alc/midi/sf2load.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Alc/midi/sf2load.c b/Alc/midi/sf2load.c index 0245e27e..ee029b2a 100644 --- a/Alc/midi/sf2load.c +++ b/Alc/midi/sf2load.c @@ -296,7 +296,7 @@ static void Soundfont_Destruct(Soundfont *self) } -#define FOURCC(a,b,c,d) (((d)<<24) | ((c)<<16) | ((b)<<8) | (a)) +#define FOURCC(a,b,c,d) ((a) | ((b)<<8) | ((c)<<16) | ((d)<<24)) #define FOURCCARGS(x) (char)((x)&0xff), (char)(((x)>>8)&0xff), (char)(((x)>>16)&0xff), (char)(((x)>>24)&0xff) typedef struct RiffHdr { ALuint mCode; @@ -500,7 +500,7 @@ static ALboolean ensureFontSanity(const Soundfont *sfont) sfont->pbag[i].mGenIdx, sfont->pgen_size); return AL_FALSE; } - if(i+1 < sfont->pbag_size && sfont->pbag[i].mGenIdx < sfont->pbag[i].mGenIdx) + if(i+1 < sfont->pbag_size && sfont->pbag[i+1].mGenIdx < sfont->pbag[i].mGenIdx) { WARN("Preset zone %d has invalid generator index (%d does not follow %d)\n", i+1, sfont->pbag[i+1].mGenIdx, sfont->pbag[i].mGenIdx); -- cgit v1.2.3