Correct web audio-related crash in seed reports
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Jul 2019 22:02:58 +0000 (22:02 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Jul 2019 22:02:58 +0000 (22:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200009
<rdar://problem/51565203>

Reviewed by Per Arne Vollan.

Source/WebCore:

Update the 'createMix' method to do proper return value checking so that
we can clear the result of MTAudioProcessingTapCreate if the create operation
failed.

* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
(WebCore::AudioSourceProviderAVFObjC::createMix):

Source/WebKit:

Revise the iOS sandbox to allow the WebContent process to communicate with
the 'com.apple.coremedia.audioprocessingtap.xpc' service, which is needed by
some types of WebAudio.

* WebProcess/com.apple.WebKit.WebContent.sb.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247701 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm
Source/WebKit/ChangeLog
Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb

index 1d5aa50..d250ad2 100644 (file)
@@ -1,3 +1,18 @@
+2019-07-22  Brent Fulgham  <bfulgham@apple.com>
+
+        Correct web audio-related crash in seed reports
+        https://bugs.webkit.org/show_bug.cgi?id=200009
+        <rdar://problem/51565203>
+
+        Reviewed by Per Arne Vollan.
+
+        Update the 'createMix' method to do proper return value checking so that
+        we can clear the result of MTAudioProcessingTapCreate if the create operation
+        failed.
+
+        * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
+        (WebCore::AudioSourceProviderAVFObjC::createMix):
+
 2019-07-22  Per Arne Vollan  <pvollan@apple.com>
 
         Prewarmed font does not find any matches
index a576b6b..22aadf6 100644 (file)
@@ -216,9 +216,13 @@ void AudioSourceProviderAVFObjC::createMix()
     };
 
     MTAudioProcessingTapRef tap = nullptr;
-    MTAudioProcessingTapCreate(kCFAllocatorDefault, &callbacks, 1, &tap);
+    OSStatus status = MTAudioProcessingTapCreate(kCFAllocatorDefault, &callbacks, 1, &tap);
     ASSERT(tap);
     ASSERT(m_tap == tap);
+    if (status != noErr) {
+        m_tap = nullptr;
+        return;
+    }
 
     RetainPtr<AVMutableAudioMixInputParameters> parameters = adoptNS([PAL::allocAVMutableAudioMixInputParametersInstance() init]);
     [parameters setAudioTapProcessor:m_tap.get()];
index 8d87b9a..e376e85 100644 (file)
@@ -1,3 +1,17 @@
+2019-07-22  Brent Fulgham  <bfulgham@apple.com>
+
+        Correct web audio-related crash in seed reports
+        https://bugs.webkit.org/show_bug.cgi?id=200009
+        <rdar://problem/51565203>
+
+        Reviewed by Per Arne Vollan.
+
+        Revise the iOS sandbox to allow the WebContent process to communicate with
+        the 'com.apple.coremedia.audioprocessingtap.xpc' service, which is needed by
+        some types of WebAudio.
+
+        * WebProcess/com.apple.WebKit.WebContent.sb.in:
+
 2019-07-22  Dean Jackson  <dino@apple.com>
 
         WebKit SPI fix for [ClickyOrb] Audio continues playing after dismissing a video preview in Safari
index 5522a92..1155684 100644 (file)
     (global-name "com.apple.containermanagerd")
     (global-name "com.apple.coremedia.assetcacheinspector")
     (global-name "com.apple.coremedia.audiodeviceclock")
-    (global-name "com.apple.coremedia.audioprocessingtap.xpc")
     (global-name "com.apple.coremedia.endpointremotecontrolsession.xpc")
     (global-name "com.apple.coremedia.sandboxserver")
     (global-name "com.apple.coremedia.videocompositor")