mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-27 10:57:22 +08:00
Fix #13276: Crash in SDL_GetAudioDeviceChannelMap
This commit is contained in:
committed by
Ryan C. Gordon
parent
8442d4f0f7
commit
de6a23028a
@@ -1606,7 +1606,9 @@ int *SDL_GetAudioDeviceChannelMap(SDL_AudioDeviceID devid, int *count)
|
|||||||
SDL_AudioDevice *device = ObtainPhysicalAudioDeviceDefaultAllowed(devid);
|
SDL_AudioDevice *device = ObtainPhysicalAudioDeviceDefaultAllowed(devid);
|
||||||
if (device) {
|
if (device) {
|
||||||
channels = device->spec.channels;
|
channels = device->spec.channels;
|
||||||
result = SDL_ChannelMapDup(device->chmap, channels);
|
if (channels > 0 && device->chmap) {
|
||||||
|
result = SDL_ChannelMapDup(device->chmap, channels);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ReleaseAudioDevice(device);
|
ReleaseAudioDevice(device);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user