mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-05-10 23:41:03 +00:00
Fix sample->valid logic in fluid_sample_import_sfont
This commit is contained in:
parent
2dc35832fc
commit
1ec9d85225
1 changed files with 5 additions and 2 deletions
|
@ -1861,6 +1861,7 @@ fluid_sample_import_sfont(fluid_sample_t* sample, SFSample* sfsample, fluid_defs
|
||||||
int ret = uncompress_vorbis_sample(sample);
|
int ret = uncompress_vorbis_sample(sample);
|
||||||
if (sample->data == NULL || ret == FLUID_FAILED)
|
if (sample->data == NULL || ret == FLUID_FAILED)
|
||||||
{
|
{
|
||||||
|
sample->valid = 0;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1869,12 +1870,14 @@ fluid_sample_import_sfont(fluid_sample_t* sample, SFSample* sfsample, fluid_defs
|
||||||
sample->valid = 0;
|
sample->valid = 0;
|
||||||
FLUID_LOG(FLUID_WARN, "Ignoring sample '%s': can't use ROM samples", sample->name);
|
FLUID_LOG(FLUID_WARN, "Ignoring sample '%s': can't use ROM samples", sample->name);
|
||||||
}
|
}
|
||||||
if (sample->end - sample->start < 8) {
|
else if (sample->end - sample->start < 8) {
|
||||||
sample->valid = 0;
|
sample->valid = 0;
|
||||||
FLUID_LOG(FLUID_WARN, "Ignoring sample '%s': too few sample data points", sample->name);
|
FLUID_LOG(FLUID_WARN, "Ignoring sample '%s': too few sample data points", sample->name);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
sample->valid = TRUE;
|
sample->valid = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
return FLUID_OK;
|
return FLUID_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue