diff -rupN fluidsynth-1.1.9.org/src/utils/fluid_sys.c fluidsynth-1.1.9/src/utils/fluid_sys.c --- fluidsynth-1.1.9.org/src/utils/fluid_sys.c 2018-01-02 10:14:56.000000000 -0500 +++ fluidsynth-1.1.9/src/utils/fluid_sys.c 2018-01-06 14:54:26.602393220 -0500 @@ -342,14 +342,16 @@ fluid_is_midifile(const char *filename) * @param filename Path to the file to check * @return TRUE if it could be a SoundFont, FALSE otherwise * - * The current implementation only checks for the "RIFF" header in the file. - * It is useful only to distinguish between SoundFont and MIDI files. + * The current implementation only checks for the "RIFF" and *sfbk* headers in + * the file. + * It is useful to distinguish between SoundFont and other (e.g. MIDI) files. */ int fluid_is_soundfont(const char *filename) { FILE* fp = fopen(filename, "rb"); char id[4]; + int rval = 0; if (fp == NULL) { return 0; @@ -358,9 +360,14 @@ fluid_is_soundfont(const char *filename) fclose(fp); return 0; } - fclose(fp); - return strncmp(id, "RIFF", 4) == 0; + if (strncmp(id, "RIFF", 4) == 0) + if (fseek(fp, 8, SEEK_SET) == 0) + if (fread((void*) id, 1, 4, fp) == 4) + if (strncmp(id, "sfbk", 4) == 0) + rval = 1; + fclose(fp); + return rval; } /**