Title: [233841] trunk/Source/WebCore
Revision
233841
Author
[email protected]
Date
2018-07-15 22:19:42 -0700 (Sun, 15 Jul 2018)

Log Message

[iOS apps on macOS] Playing embedded Twitter videos in the News app crashes the web process
https://bugs.webkit.org/show_bug.cgi?id=187690
<rdar://problem/41869703>

Reviewed by Tim Horton.

Work around unexpected behavior when soft-linking AVFoundation. After using `dlopen_preflight` to check for the
existence of a library prior to loading the library using `dlopen`, `dlsym` subsequently returns null for some
symbols that would otherwise be available. This causes us to RELEASE_ASSERT later down the road when we try to
load AVAudioSessionModeDefault in AudioSessionIOS.mm.

To fix this for now, simply check for the library directly instead of using the more lightweight preflight
check. See clone: <rdar://problem/42224780> for more detail.

* platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
(WebCore::AVFoundationMIMETypeCache::isAvailable const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (233840 => 233841)


--- trunk/Source/WebCore/ChangeLog	2018-07-15 04:26:36 UTC (rev 233840)
+++ trunk/Source/WebCore/ChangeLog	2018-07-16 05:19:42 UTC (rev 233841)
@@ -1,3 +1,22 @@
+2018-07-15  Wenson Hsieh  <[email protected]>
+
+        [iOS apps on macOS] Playing embedded Twitter videos in the News app crashes the web process
+        https://bugs.webkit.org/show_bug.cgi?id=187690
+        <rdar://problem/41869703>
+
+        Reviewed by Tim Horton.
+
+        Work around unexpected behavior when soft-linking AVFoundation. After using `dlopen_preflight` to check for the
+        existence of a library prior to loading the library using `dlopen`, `dlsym` subsequently returns null for some
+        symbols that would otherwise be available. This causes us to RELEASE_ASSERT later down the road when we try to
+        load AVAudioSessionModeDefault in AudioSessionIOS.mm.
+
+        To fix this for now, simply check for the library directly instead of using the more lightweight preflight
+        check. See clone: <rdar://problem/42224780> for more detail.
+
+        * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
+        (WebCore::AVFoundationMIMETypeCache::isAvailable const):
+
 2018-07-14  Simon Fraser  <[email protected]>
 
         Shrink StyleFillData, StyleStrokeData and StyleMiscData

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm (233840 => 233841)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm	2018-07-15 04:26:36 UTC (rev 233840)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm	2018-07-16 05:19:42 UTC (rev 233841)
@@ -35,7 +35,9 @@
 #import <pal/cf/CoreMediaSoftLink.h>
 
 #if ENABLE(VIDEO) && USE(AVFOUNDATION)
+#if !PLATFORM(IOSMAC)
 SOFT_LINK_FRAMEWORK_OPTIONAL_PREFLIGHT(AVFoundation)
+#endif
 SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
 SOFT_LINK_CLASS(AVFoundation, AVURLAsset)
 #endif
@@ -92,7 +94,13 @@
 bool AVFoundationMIMETypeCache::isAvailable() const
 {
 #if ENABLE(VIDEO) && USE(AVFOUNDATION)
+#if PLATFORM(IOSMAC)
+    // FIXME: This should be using AVFoundationLibraryIsAvailable() instead, but doing so causes soft-linking
+    // to subsequently fail on certain symbols. See <rdar://problem/42224780> for more details.
+    return AVFoundationLibrary();
+#else
     return AVFoundationLibraryIsAvailable();
+#endif
 #else
     return false;
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to