mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-12-26 13:06:46 +00:00
sdl2_sink: Check for null string when loading SDL audio devices
Attempting to place a null string into a vector of strings causes an error that closes the application. Don't.
This commit is contained in:
parent
d574bb4610
commit
5c7eef3756
|
@ -230,7 +230,10 @@ std::vector<std::string> ListSDLSinkDevices(bool capture) {
|
|||
|
||||
const int device_count = SDL_GetNumAudioDevices(capture);
|
||||
for (int i = 0; i < device_count; ++i) {
|
||||
device_list.emplace_back(SDL_GetAudioDeviceName(i, 0));
|
||||
const char* name = SDL_GetAudioDeviceName(i, 0);
|
||||
if (name != nullptr) {
|
||||
device_list.emplace_back(name);
|
||||
}
|
||||
}
|
||||
|
||||
return device_list;
|
||||
|
|
Loading…
Reference in a new issue