coreaudio: Added some NULL pointer checks.

These might not be necessary, just trying to track down a reported issue.

Reference Issue #12660.
This commit is contained in:
Ryan C. Gordon
2025-03-28 18:39:16 -04:00
parent 712c76fdc1
commit 536a1a236f

View File

@@ -341,7 +341,7 @@ static void ResumeAudioDevices(void)
static void InterruptionBegin(SDL_AudioDevice *device)
{
if (device != NULL && device->hidden->audioQueue != NULL) {
if (device != NULL && device->hidden != NULL && device->hidden->audioQueue != NULL) {
device->hidden->interrupted = true;
AudioQueuePause(device->hidden->audioQueue);
}
@@ -366,7 +366,7 @@ static void InterruptionEnd(SDL_AudioDevice *device)
{
@synchronized(self) {
NSNumber *type = note.userInfo[AVAudioSessionInterruptionTypeKey];
if (type.unsignedIntegerValue == AVAudioSessionInterruptionTypeBegan) {
if (type && (type.unsignedIntegerValue == AVAudioSessionInterruptionTypeBegan)) {
InterruptionBegin(self.device);
} else {
InterruptionEnd(self.device);