Fix #13276: Crash in SDL_GetAudioDeviceChannelMap
(cherry picked from commit de6a23028a)
This commit is contained in:
1 parent
3e0ce51067
commit
554bee6aae
1 file changed
+2
@@ -1575,8 +1575,10 @@ 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;
|
||||||
|
if (channels > 0 && device->chmap) {
|
||||||
result = SDL_ChannelMapDup(device->chmap, channels);
|
result = SDL_ChannelMapDup(device->chmap, channels);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ReleaseAudioDevice(device);
|
ReleaseAudioDevice(device);
|
||||||
|
|
||||||
if (count) {
|
if (count) {
|
||||||
|
|||||||
Reference in new issue
Block a user