Commit cdc7a419 authored by haraken@chromium.org's avatar haraken@chromium.org

AudioNodeOutput::enable() and AudioNodeOutput::disable() should not be reentered

AudioNodeOutput::disable() can be reentered and causes the following crash.

ASSERTION FAILED: m_outputs.contains(&output)
../../third_party/WebKit/Source/modules/webaudio/AudioNodeInput.cpp(98) : void blink::AudioNodeInput::disable(blink::AudioNodeOutput &)
Received signal 11 SEGV_MAPERR 0000fbadbeef

To avoid AudioNodeOutput::disable() from getting reentered, this CL moves the place
of flipping m_isEnabled.

The same issue is in AudioNodeOutput::enable() and this CL addresses the issue as well.

BUG=411989
TEST=None, it's hard to create a simple test html that reproduces the bug.

Review URL: https://codereview.chromium.org/558523002

git-svn-id: svn://svn.chromium.org/blink/trunk@181693 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 2d88cb7a
...@@ -222,9 +222,9 @@ void AudioNodeOutput::disable() ...@@ -222,9 +222,9 @@ void AudioNodeOutput::disable()
ASSERT(context()->isGraphOwner()); ASSERT(context()->isGraphOwner());
if (m_isEnabled) { if (m_isEnabled) {
m_isEnabled = false;
for (InputsIterator i = m_inputs.begin(); i != m_inputs.end(); ++i) for (InputsIterator i = m_inputs.begin(); i != m_inputs.end(); ++i)
i->key->disable(*this); i->key->disable(*this);
m_isEnabled = false;
} }
} }
...@@ -233,9 +233,9 @@ void AudioNodeOutput::enable() ...@@ -233,9 +233,9 @@ void AudioNodeOutput::enable()
ASSERT(context()->isGraphOwner()); ASSERT(context()->isGraphOwner());
if (!m_isEnabled) { if (!m_isEnabled) {
m_isEnabled = true;
for (InputsIterator i = m_inputs.begin(); i != m_inputs.end(); ++i) for (InputsIterator i = m_inputs.begin(); i != m_inputs.end(); ++i)
i->key->enable(*this); i->key->enable(*this);
m_isEnabled = true;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment