Skip to content

Commit

Permalink
Add warning if soundfont bigger 2GB (#811)
Browse files Browse the repository at this point in the history
Advice the user to use fluidsynth 2.2.0 or later when loading soundfonts > 2GB
  • Loading branch information
derselbst authored Mar 14, 2021
1 parent 2c1561e commit 8a778e0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/sfloader/fluid_sffile.c
Original file line number Diff line number Diff line change
Expand Up @@ -2406,6 +2406,14 @@ static int fluid_sffile_read_wav(SFData *sf, unsigned int start, unsigned int en

if(sf->fcbs->fread(loaded_data, num_samples * sizeof(short), sf->sffd) == FLUID_FAILED)
{
#if FLUID_VERSION_CHECK(FLUIDSYNTH_VERSION_MAJOR, FLUIDSYNTH_VERSION_MINOR, FLUIDSYNTH_VERSION_MICRO) < FLUID_VERSION_CHECK(2,2,0)
if((int)(num_samples * sizeof(short)) < 0)
{
FLUID_LOG(FLUID_INFO,
"This SoundFont seems to be bigger than 2GB, which is not supported in this version of fluidsynth. "
"You need to use at least fluidsynth 2.2.0");
}
#endif
FLUID_LOG(FLUID_ERR, "Failed to read sample data");
goto error_exit;
}
Expand Down

0 comments on commit 8a778e0

Please sign in to comment.