Files
ppsspp/libretro
Mark Pearce 00f5f4fc90 libretro: guard output_audio_buffer with a mutex
System_AudioPushSamples() runs on the emu thread when one is active
(GL/GLCore backends) and appends to / reallocs output_audio_buffer,
while retro_run() on the libretro thread reads .data/.size and resets
.size in upload_output_audio_buffer(), unsynchronized. A realloc on
the emu thread can free the pointer while audio_batch_cb() reads it.

Guard the four access sites with a mutex (<mutex> was already included
in this file, unused). The lock is held across audio_batch_cb() — no
second buffer; worst case the emu thread briefly backpressures while
the frontend syncs audio. Behavior is otherwise unchanged.
2026-07-07 11:02:00 +08:00
..
2022-11-24 12:42:38 -04:00