LibWeb: Validate AudioParam context in AudioNode::connect()

An exception is now thown if an `AudioNode` attempts to connect to an
`AudioParam` from a different `BaseAudioContext`.
This commit is contained in:
Tim Ledbetter 2025-01-08 20:04:28 +00:00 committed by Tim Ledbetter
parent 2edd0812ca
commit 5c57acf140
Notes: github-actions[bot] 2025-01-09 11:35:50 +00:00
14 changed files with 54 additions and 43 deletions

View file

@ -16,7 +16,7 @@ GC_DEFINE_ALLOCATOR(ConstantSourceNode);
ConstantSourceNode::ConstantSourceNode(JS::Realm& realm, GC::Ref<BaseAudioContext> context, ConstantSourceOptions const& options)
: AudioScheduledSourceNode(realm, context)
, m_offset(AudioParam::create(realm, options.offset, NumericLimits<float>::lowest(), NumericLimits<float>::max(), Bindings::AutomationRate::ARate))
, m_offset(AudioParam::create(realm, context, options.offset, NumericLimits<float>::lowest(), NumericLimits<float>::max(), Bindings::AutomationRate::ARate))
{
}