Browse Source

coreaudio: Added some NULL pointer checks.

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

Reference Issue #12660.
Ryan C. Gordon 3 weeks ago
parent
commit
536a1a236f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/audio/coreaudio/SDL_coreaudio.m

+ 2 - 2
src/audio/coreaudio/SDL_coreaudio.m

@@ -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);