diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 7420708abc..794d114b63 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -1575,7 +1575,9 @@ int *SDL_GetAudioDeviceChannelMap(SDL_AudioDeviceID devid, int *count) SDL_AudioDevice *device = ObtainPhysicalAudioDeviceDefaultAllowed(devid); if (device) { channels = device->spec.channels; - result = SDL_ChannelMapDup(device->chmap, channels); + if (channels > 0 && device->chmap) { + result = SDL_ChannelMapDup(device->chmap, channels); + } } ReleaseAudioDevice(device);