mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-02-20 19:02:04 +00:00
Fix a NULL deref in jack driver
This commit is contained in:
parent
85f94c61c9
commit
eac0de0345
1 changed files with 5 additions and 4 deletions
|
@ -188,7 +188,8 @@ new_fluid_jack_client(fluid_settings_t *settings, int isaudio, void *driver)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// do not free client_ref and do not goto error_recovery
|
// do not free client_ref and do not goto error_recovery
|
||||||
// client_ref is being used by another audio or midi driver. Freeing it here will create a double free.
|
// client_ref is being used by another audio or midi driver. Freeing it here will lead to a double free.
|
||||||
|
client_ref = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
fluid_mutex_unlock(last_client_mutex); /* -- unlock last_client */
|
fluid_mutex_unlock(last_client_mutex); /* -- unlock last_client */
|
||||||
|
@ -357,7 +358,7 @@ fluid_jack_client_register_ports(void *driver, int isaudio, jack_client_t *clien
|
||||||
|
|
||||||
if(dev->midi_port[i] == NULL)
|
if(dev->midi_port[i] == NULL)
|
||||||
{
|
{
|
||||||
FLUID_LOG(FLUID_ERR, "Failed to create Jack MIDI port");
|
FLUID_LOG(FLUID_ERR, "Failed to create Jack MIDI port '%s'", name);
|
||||||
FLUID_FREE(dev->midi_port);
|
FLUID_FREE(dev->midi_port);
|
||||||
dev->midi_port = NULL;
|
dev->midi_port = NULL;
|
||||||
return FLUID_FAILED;
|
return FLUID_FAILED;
|
||||||
|
@ -397,7 +398,8 @@ fluid_jack_client_register_ports(void *driver, int isaudio, jack_client_t *clien
|
||||||
|
|
||||||
if(dev->output_ports[0] == NULL || dev->output_ports[1] == NULL)
|
if(dev->output_ports[0] == NULL || dev->output_ports[1] == NULL)
|
||||||
{
|
{
|
||||||
FLUID_LOG(FLUID_ERR, "Failed to create Jack audio port");
|
FLUID_LOG(FLUID_ERR, "Failed to create Jack audio port '%s'",
|
||||||
|
(dev->output_ports[0] == NULL ? (dev->output_ports[1] == NULL ? "left & right" : "left") : "right"));
|
||||||
goto error_recovery;
|
goto error_recovery;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -869,7 +871,6 @@ new_fluid_jack_midi_driver(fluid_settings_t *settings,
|
||||||
|
|
||||||
if(!dev->client_ref)
|
if(!dev->client_ref)
|
||||||
{
|
{
|
||||||
FLUID_LOG(FLUID_PANIC, "Out of memory");
|
|
||||||
goto error_recovery;
|
goto error_recovery;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue