Fix dereference before NULL check in defsfont/ramsfont (ticket #117)

Patch credit: surabhi-mishra
This commit is contained in:
David Henningsson 2013-07-16 10:46:55 +00:00
parent 862314c134
commit 89898893b1
2 changed files with 2 additions and 2 deletions

View file

@ -823,7 +823,7 @@ fluid_defpreset_noteon(fluid_defpreset_t* preset, fluid_synth_t* synth, int chan
/* make sure this instrument zone has a valid sample */
sample = fluid_inst_zone_get_sample(inst_zone);
if (fluid_sample_in_rom(sample) || (sample == NULL)) {
if ((sample == NULL) || fluid_sample_in_rom(sample)) {
inst_zone = fluid_inst_zone_next(inst_zone);
continue;
}

View file

@ -914,7 +914,7 @@ fluid_rampreset_noteon (fluid_rampreset_t* preset, fluid_synth_t* synth, int cha
/* make sure this instrument zone has a valid sample */
sample = fluid_inst_zone_get_sample(inst_zone);
if (fluid_sample_in_rom(sample) || (sample == NULL)) {
if ((sample == NULL) || fluid_sample_in_rom(sample)) {
inst_zone = fluid_inst_zone_next(inst_zone);
continue;
}