mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-10 23:11:41 +00:00
only assure sample loopend is within sdtachunk
This commit is contained in:
parent
c149678912
commit
cc84b40736
1 changed files with 6 additions and 2 deletions
|
@ -3170,8 +3170,12 @@ fixup_sample (SFData * sf)
|
||||||
|
|
||||||
/* The SoundFont 2.4 spec defines the loop start index as the first sample point of the loop */
|
/* The SoundFont 2.4 spec defines the loop start index as the first sample point of the loop */
|
||||||
inv_start = (sam->loopstart < sam->start) || (sam->loopstart >= sam->loopend);
|
inv_start = (sam->loopstart < sam->start) || (sam->loopstart >= sam->loopend);
|
||||||
/* while loop end is the first point AFTER the last sample of the loop */
|
/* while loop end is the first point AFTER the last sample of the loop.
|
||||||
inv_end = (sam->loopend > sam->end) || (sam->loopstart >= sam->loopend);
|
* this is as it should be. however we cannot be sure whether any of sam.loopend or sam.end
|
||||||
|
* is correct. hours of thinking through this have concluded, that it would be best practice
|
||||||
|
* to mangle with loops as little as necessary by only making sure loopend is within
|
||||||
|
* sdtachunk_size. incorrect soundfont shall preferably fail loudly. */
|
||||||
|
inv_end = (sam->loopend > sdtachunk_size) || (sam->loopstart >= sam->loopend);
|
||||||
|
|
||||||
/* if sample is not a ROM sample and end is over the sample data chunk
|
/* if sample is not a ROM sample and end is over the sample data chunk
|
||||||
or sam start is greater than 4 less than the end (at least 4 samples) */
|
or sam start is greater than 4 less than the end (at least 4 samples) */
|
||||||
|
|
Loading…
Reference in a new issue