-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NULL pointer deref if dynamic-sample-loading is enabled. #635
Comments
It is pretty trivial to add the preset notification to
We need to unselect the preset in |
Sending a FLUID_PRESET_SELECTED signal for a preset that has not been selected seems wrong to me. Is this a crash in an actual use-case? I mean is starting a voice for a preset that has not been assigned to a MIDI channel a feature we want to support with dynamic sample loading? Maybe it would be easier to add a check in fluid_synth_start so that the null-deref can't happen and require the user to select the preset on a MIDI channel before starting the voice? |
When notes are played on a channel that has no program assigned (yet), I would like to play these notes with a specific preset. This preset is (most likely) not used on any channel. And since Whether we want to support this when dynamic sample loading is enabled is a different story. Ofc we could just error out in In order to support this use-case, one would need to add a |
The segfault is obviously a bug which we should fix or guard against. But the whole idea behind dynamic sample loading is to load the samples into memory when the preset has been selected on a channel and unload it again when it is unselected. Changing that to load and unload the samples when a voice for that preset has been started / stopped seems to be quite a large change to the underlying idea and quite frankly feels like a hack to me. A cleaner solution might be to expose the loading / unloading methods the the user. |
Ok. I'll add a guard into
Oh no. No more complexity. Btw, in case you missed it: PR 604 is ready. |
FluidSynth version
2.1.2 (confirmed), most likely up to 2.0.0 (where dynamic-sample-loading was introduced)
Describe the bug
dsp_data
is NULL, becausevoice->sample->data
is NULL.Expected behavior
Should not crash.
Steps to reproduce
Suppose we want to start a voice with given preset, but this preset is not assigned to any MIDI channel currently:
When disabling dynamic sample loading, everything works fine.
The text was updated successfully, but these errors were encountered: