Title: [290837] trunk/Source/WebCore
- Revision
- 290837
- Author
- [email protected]
- Date
- 2022-03-04 10:46:06 -0800 (Fri, 04 Mar 2022)
Log Message
[Cocoa] Crash in MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL
https://bugs.webkit.org/show_bug.cgi?id=237456
rdar://80407863
Reviewed by Jer Noble.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::enableInheritURIQueryComponent const): Create
and use a static, never destroyed, AtomString instead of creating one every time
a AVURLAsset is created. New method used by both AVF media players.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::createAVAssetForURL): Call enableInheritURIQueryComponent.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (290836 => 290837)
--- trunk/Source/WebCore/ChangeLog 2022-03-04 18:03:35 UTC (rev 290836)
+++ trunk/Source/WebCore/ChangeLog 2022-03-04 18:46:06 UTC (rev 290837)
@@ -1,3 +1,22 @@
+2022-03-04 Eric Carlson <[email protected]>
+
+ [Cocoa] Crash in MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL
+ https://bugs.webkit.org/show_bug.cgi?id=237456
+ rdar://80407863
+
+ Reviewed by Jer Noble.
+
+ * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+ (WebCore::MediaPlayerPrivateAVFoundation::enableInheritURIQueryComponent const): Create
+ and use a static, never destroyed, AtomString instead of creating one every time
+ a AVURLAsset is created. New method used by both AVF media players.
+ * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+
+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+ (WebCore::MediaPlayerPrivateAVFoundationCF::createAVAssetForURL): Call enableInheritURIQueryComponent.
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
+
2022-03-04 Sihui Liu <[email protected]>
IDB serialization thread should pass isolated copy of IndexIDToIndexKeyMap to storage thread
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (290836 => 290837)
--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp 2022-03-04 18:03:35 UTC (rev 290836)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp 2022-03-04 18:46:06 UTC (rev 290837)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2020 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2022 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -1079,6 +1079,12 @@
return false;
}
+bool MediaPlayerPrivateAVFoundation::shouldEnableInheritURIQueryComponent() const
+{
+ static NeverDestroyed<const AtomString> iTunesInheritsURIQueryComponent(MAKE_STATIC_STRING_IMPL("x-itunes-inherit-uri-query-component"));
+ return player()->doesHaveAttribute(iTunesInheritsURIQueryComponent);
+}
+
void MediaPlayerPrivateAVFoundation::queueTaskOnEventLoop(Function<void()>&& task)
{
ASSERT(isMainThread());
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (290836 => 290837)
--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h 2022-03-04 18:03:35 UTC (rev 290836)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h 2022-03-04 18:46:06 UTC (rev 290837)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2022 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -331,6 +331,8 @@
bool loadingMetadata() const { return m_loadingMetadata; }
+ bool shouldEnableInheritURIQueryComponent() const;
+
private:
MediaPlayer* m_player;
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (290836 => 290837)
--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2022-03-04 18:03:35 UTC (rev 290836)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2022-03-04 18:46:06 UTC (rev 290837)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2022 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -507,10 +507,8 @@
setDelayCallbacks(true);
- bool inheritURI = player()->doesHaveAttribute("x-itunes-inherit-uri-query-component");
-
m_avfWrapper = new AVFWrapper(this);
- m_avfWrapper->createAssetForURL(url, inheritURI);
+ m_avfWrapper->createAssetForURL(url, shouldEnableInheritURIQueryComponent());
setDelayCallbacks(false);
m_avfWrapper->checkPlayability();
}
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (290836 => 290837)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2022-03-04 18:03:35 UTC (rev 290836)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2022-03-04 18:46:06 UTC (rev 290837)
@@ -890,8 +890,8 @@
if ([headerFields count])
[options setObject:headerFields.get() forKey:@"AVURLAssetHTTPHeaderFieldsKey"];
- if (player()->doesHaveAttribute("x-itunes-inherit-uri-query-component"))
- [options setObject:@YES forKey: AVURLAssetInheritURIQueryComponentFromReferencingURIKey];
+ if (shouldEnableInheritURIQueryComponent())
+ [options setObject:@YES forKey:AVURLAssetInheritURIQueryComponentFromReferencingURIKey];
if (PAL::canLoad_AVFoundation_AVURLAssetUseClientURLLoadingExclusively())
[options setObject:@YES forKey:AVURLAssetUseClientURLLoadingExclusively];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes