Ver Fonte

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 há 11 meses atrás
pai
commit
536a1a236f
1 ficheiros alterados com 2 adições e 2 exclusões
  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);