mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-02-23 20:31:43 +00:00
Ignore extra size in SoundFont smpl chunk so that FluidSynth can load 24 bit SoundFont files as 16 bit, rather than rejecting the file.
This commit is contained in:
parent
19cd260522
commit
8e11587d4e
1 changed files with 5 additions and 2 deletions
|
@ -2024,7 +2024,10 @@ process_sdta (int size, SFData * sf, FILE * fd)
|
|||
return (gerr (ErrCorr,
|
||||
_("Expected SMPL chunk found invalid id instead")));
|
||||
|
||||
if ((size - chunk.size) != 0)
|
||||
/* SDTA chunk may also contain sm24 chunk for 24 bit samples
|
||||
* (not yet supported), only an error if SMPL chunk size is
|
||||
* greater than SDTA. */
|
||||
if (chunk.size > size)
|
||||
return (gerr (ErrCorr, _("SDTA chunk size mismatch")));
|
||||
|
||||
/* sample data follows */
|
||||
|
@ -2034,7 +2037,7 @@ process_sdta (int size, SFData * sf, FILE * fd)
|
|||
sdtachunk_size = chunk.size;
|
||||
sf->samplesize = chunk.size;
|
||||
|
||||
FSKIP (chunk.size, fd);
|
||||
FSKIP (size, fd);
|
||||
|
||||
return (OK);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue