diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 5631bb2fd..d6d835351 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -722,10 +722,16 @@ SDL_GetAudioDeviceName(int index, int iscapture) } if ((iscapture) && (current_audio.impl.OnlyHasDefaultInputDevice)) { + if (index > 0) { + goto no_such_device; + } return DEFAULT_INPUT_DEVNAME; } if ((!iscapture) && (current_audio.impl.OnlyHasDefaultOutputDevice)) { + if (index > 0) { + goto no_such_device; + } return DEFAULT_OUTPUT_DEVNAME; }