Commit 6f4e2083 authored by Robert Reif's avatar Robert Reif Committed by Alexandre Julliard

winecfg: Fix audio crash when no drivers are available.

parent b4a5df1c
......@@ -519,8 +519,13 @@ static void findAudioDrivers(void)
SetCursor(old_cursor);
/* terminate list with empty driver */
loadedAudioDrv = HeapReAlloc(GetProcessHeap(), 0, loadedAudioDrv, (numFound + 1) * sizeof(AUDIO_DRIVER));
CopyMemory(&loadedAudioDrv[numFound], pAudioDrv, sizeof(AUDIO_DRIVER));
if (numFound) {
loadedAudioDrv = HeapReAlloc(GetProcessHeap(), 0, loadedAudioDrv, (numFound + 1) * sizeof(AUDIO_DRIVER));
CopyMemory(&loadedAudioDrv[numFound], pAudioDrv, sizeof(AUDIO_DRIVER));
} else {
loadedAudioDrv = HeapAlloc(GetProcessHeap(), 0, sizeof(AUDIO_DRIVER));
ZeroMemory(&loadedAudioDrv[0], sizeof(AUDIO_DRIVER));
}
}
/* check local copy of registry string for unloadable drivers */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment