PortAudio / portaudio

PortAudio is a cross-platform, open-source C language library for real-time audio input and output.
Other
1.46k stars 303 forks source link

PaPulseAudio_Initialize does not unlock correctly on error path #848

Closed RossBencina closed 9 months ago

RossBencina commented 1 year ago

This PR fixes an access-after free when calling PaPulseAudio_UnLock

https://github.com/PortAudio/portaudio/pull/847

However the bigger issue is that PaPulseAudio_UnLock is not called consistently. Either PaPulseAudio_UnLock needs to be called before or after goto error but not both or neither. On line 563 it gets locked, but there is also a goto error prior to that on line 550. Some later goto error paths unlock, some don't.

One possible fix is to have an error_unlock: label prior to the error label that is used for paths that should unlock.

RossBencina commented 11 months ago

@illuusio assigning this to you