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

Changeset 277177 in webkit


Ignore:
Timestamp:
May 7, 2021, 9:42:35 AM (5 years ago)
Author:
Chris Dumez
Message:

AudioWorkletProcessor which does not extend base class crashes Safari
​https://bugs.webkit.org/show_bug.cgi?id=225449
<rdar://problem/77624792>

Reviewed by Sam Weinig.

Update AudioWorkletGlobalScope::createProcessor() to validate the type of the processor
after constructing it.

  • Modules/webaudio/AudioWorkletGlobalScope.cpp:

(WebCore::AudioWorkletGlobalScope::createProcessor):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r277175 r277177  
     12021-05-07  Chris Dumez  <cdumez@apple.com>
     2
     3        AudioWorkletProcessor which does not extend base class crashes Safari
     4        https://bugs.webkit.org/show_bug.cgi?id=225449
     5        <rdar://problem/77624792>
     6
     7        Reviewed by Sam Weinig.
     8
     9        Update AudioWorkletGlobalScope::createProcessor() to validate the type of the processor
     10        after constructing it.
     11
     12        * Modules/webaudio/AudioWorkletGlobalScope.cpp:
     13        (WebCore::AudioWorkletGlobalScope::createProcessor):
     14
    1152021-05-07  Philippe Normand  <pnormand@igalia.com>
    216
  • trunk/Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.cpp

    r274989 r277177  
    151151    RETURN_IF_EXCEPTION(scope, nullptr);
    152152
    153     auto& jsProcessor = *JSC::jsCast<JSAudioWorkletProcessor*>(object);
    154     jsProcessor.wrapped().setProcessCallback(makeUnique<JSCallbackDataStrong>(&jsProcessor, globalObject));
    155 
    156     return &jsProcessor.wrapped();
     153    auto* jsProcessor = JSC::jsDynamicCast<JSAudioWorkletProcessor*>(vm, object);
     154    if (!jsProcessor)
     155        return nullptr;
     156
     157    jsProcessor->wrapped().setProcessCallback(makeUnique<JSCallbackDataStrong>(jsProcessor, globalObject));
     158
     159    return &jsProcessor->wrapped();
    157160}
    158161
Note: See TracChangeset for help on using the changeset viewer.