mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-12-01 00:21:14 +00:00
fix a NULL deref in coreaudio driver
This commit is contained in:
parent
ffdf5b89d7
commit
31ccc6b6a0
1 changed files with 7 additions and 4 deletions
|
@ -266,10 +266,7 @@ new_fluid_core_audio_driver2(fluid_settings_t *settings, fluid_audio_func_t func
|
|||
}
|
||||
}
|
||||
|
||||
if(devname)
|
||||
{
|
||||
FLUID_FREE(devname); /* free device name */
|
||||
}
|
||||
FLUID_FREE(devname); /* free device name */
|
||||
|
||||
dev->buffer_size = period_size * periods;
|
||||
|
||||
|
@ -322,6 +319,12 @@ new_fluid_core_audio_driver2(fluid_settings_t *settings, fluid_audio_func_t func
|
|||
|
||||
dev->buffers[0] = FLUID_ARRAY(float, dev->buffer_size);
|
||||
dev->buffers[1] = FLUID_ARRAY(float, dev->buffer_size);
|
||||
|
||||
if(dev->buffers[0] == NULL || dev->buffers[1] == NULL)
|
||||
{
|
||||
FLUID_LOG(FLUID_ERR, "Out of memory.");
|
||||
goto error_recovery;
|
||||
}
|
||||
|
||||
// Initialize the audio unit
|
||||
status = AudioUnitInitialize(dev->outputUnit);
|
||||
|
|
Loading…
Reference in a new issue