From b04dbe3b9cbc1e1f51e0a12f9d13c5a41ab39ca9 Mon Sep 17 00:00:00 2001 From: derselbst Date: Fri, 11 Aug 2017 15:05:19 +0200 Subject: [PATCH] fix incorrect loop check --- fluidsynth/src/sfloader/fluid_defsfont.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fluidsynth/src/sfloader/fluid_defsfont.c b/fluidsynth/src/sfloader/fluid_defsfont.c index e3ce1848..6d7d6cf7 100644 --- a/fluidsynth/src/sfloader/fluid_defsfont.c +++ b/fluidsynth/src/sfloader/fluid_defsfont.c @@ -1963,7 +1963,7 @@ fluid_sample_import_sfont(fluid_sample_t* sample, SFSample* sfsample, fluid_defs /* loop is fowled?? (cluck cluck :) */ if (sample->loopend > sample->end || sample->loopstart >= sample->loopend || - sample->loopstart <= sample->start) + sample->loopstart < sample->start) { /* can pad loop by 8 samples and ensure at least 4 for loop (2*8+4) */ if ((sample->end - sample->start) >= 20) @@ -3351,9 +3351,14 @@ fixup_sample (SFData * sf) return (OK); } - /* compressed samples get fixed up after decompression */ else if (sam->sampletype & FLUID_SAMPLETYPE_OGG_VORBIS) - {} + { + /* + * compressed samples get fixed up after decompression + * + * however we cant use the logic below, because uncompressed samples are stored in individual buffers + */ + } else if (invalid_loopstart || invalid_loopend || loopend_end_mismatch) { /* loop is fowled?? (cluck cluck :) */