From 5dc3029a5535a510ffaf3987b75564bd3fe253c4 Mon Sep 17 00:00:00 2001 From: Paul Adenot Date: Mon, 31 Jan 2022 10:17:04 +0000 Subject: [PATCH] Bug 1749308 - Don't attempt to send a message to the graph after a ScriptProcessorNode has been marked for collection. r=karlt Differential Revision: https://phabricator.services.mozilla.com/D135612 --- dom/media/tests/crashtests/1749308.html | 18 ++++++++++++++++++ dom/media/tests/crashtests/crashtests.list | 1 + dom/media/webaudio/ScriptProcessorNode.cpp | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 dom/media/tests/crashtests/1749308.html diff --git a/dom/media/tests/crashtests/1749308.html b/dom/media/tests/crashtests/1749308.html new file mode 100644 index 000000000000..1c17c6e35c02 --- /dev/null +++ b/dom/media/tests/crashtests/1749308.html @@ -0,0 +1,18 @@ + + + + + + diff --git a/dom/media/tests/crashtests/crashtests.list b/dom/media/tests/crashtests/crashtests.list index ab0868106ad1..82ecd65c22c0 100644 --- a/dom/media/tests/crashtests/crashtests.list +++ b/dom/media/tests/crashtests/crashtests.list @@ -35,3 +35,4 @@ load 1576938.html skip-if(Android) pref(media.getusermedia.audiocapture.enabled,true) load 1573536.html skip-if(!Android) pref(media.getusermedia.audiocapture.enabled,true) pref(media.navigator.permission.device,false) load 1573536.html # media.navigator.permission.device is mobile-only, so other platforms fail to set it (Bug 1350948) load 1594136.html +load 1749308.html diff --git a/dom/media/webaudio/ScriptProcessorNode.cpp b/dom/media/webaudio/ScriptProcessorNode.cpp index 8ba30f71ba5a..0abadc204e2b 100644 --- a/dom/media/webaudio/ScriptProcessorNode.cpp +++ b/dom/media/webaudio/ScriptProcessorNode.cpp @@ -505,7 +505,7 @@ void ScriptProcessorNode::EventListenerAdded(nsAtom* aType) { void ScriptProcessorNode::EventListenerRemoved(nsAtom* aType) { AudioNode::EventListenerRemoved(aType); - if (aType == nsGkAtoms::onaudioprocess) { + if (aType == nsGkAtoms::onaudioprocess && mTrack) { UpdateConnectedStatus(); } }