⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 201615 in webkit


Ignore:
Timestamp:
Jun 2, 2016, 1:37:22 PM (10 years ago)
Author:
Chris Dumez
Message:

Crash under CachedResource::addClientToSet()
https://bugs.webkit.org/show_bug.cgi?id=158310
<rdar://problem/23643359>

Reviewed by Eric Carlson.

Only call CachedResource::addClient() on the resource returned
by CachedResourceLoader::requestMedia() if the resource is
non-null. CachedResourceLoader::requestMedia() can return null
in some cases so we need to handle this properly.

No new tests, no known reproduction case.

  • platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:

(WebCore::WebCoreAVFResourceLoader::startLoading):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r201614 r201615  
     12016-06-02  Chris Dumez  <cdumez@apple.com>
     2
     3        Crash under CachedResource::addClientToSet()
     4        https://bugs.webkit.org/show_bug.cgi?id=158310
     5        <rdar://problem/23643359>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Only call CachedResource::addClient() on the resource returned
     10        by CachedResourceLoader::requestMedia() if the resource is
     11        non-null. CachedResourceLoader::requestMedia() can return null
     12        in some cases so we need to handle this properly.
     13
     14        No new tests, no known reproduction case.
     15
     16        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
     17        (WebCore::WebCoreAVFResourceLoader::startLoading):
     18
    1192016-06-02  Chris Dumez  <cdumez@apple.com>
    220
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm

    r198292 r201615  
    7171    // is in a user-agent shadow tree. See <https://bugs.webkit.org/show_bug.cgi?id=155505>.
    7272    CachedResourceRequest request(nsRequest, ResourceLoaderOptions(SendCallbacks, DoNotSniffContent, BufferData, DoNotAllowStoredCredentials, DoNotAskClientForCrossOriginCredentials, ClientDidNotRequestCredentials, DoSecurityCheck, UseDefaultOriginRestrictionsForType, DoNotIncludeCertificateInfo, ContentSecurityPolicyImposition::DoPolicyCheck, DefersLoadingPolicy::AllowDefersLoading, CachingPolicy::DisallowCaching));
     73    request.mutableResourceRequest().setPriority(ResourceLoadPriority::Low);
     74    if (auto* loader = m_parent->player()->cachedResourceLoader())
     75        m_resource = loader->requestMedia(request);
    7376
    74     request.mutableResourceRequest().setPriority(ResourceLoadPriority::Low);
    75     if (CachedResourceLoader* loader = m_parent->player()->cachedResourceLoader()) {
    76         m_resource = loader->requestMedia(request);
     77    if (m_resource)
    7778        m_resource->addClient(this);
    78     } else {
    79         m_resource = nullptr;
     79    else {
    8080        LOG_ERROR("Failed to start load for media at url %s", [[[nsRequest URL] absoluteString] UTF8String]);
    8181        [m_avRequest.get() finishLoadingWithError:0];
Note: See TracChangeset for help on using the changeset viewer.