зеркало из https://github.com/mozilla/gecko-dev.git
Bug 845960 - Fix a crash resulted from a missing nullcheck for the optional failure callback of decodeAudioData; r=bzbarsky
This commit is contained in:
Родитель
1d1e78217e
Коммит
0d68519dd2
|
@ -868,8 +868,10 @@ WebAudioDecodeJob::OnFailure(ErrorCode aErrorCode)
|
|||
|
||||
// Ignore errors in calling the callback, since there is not much that we can
|
||||
// do about it here.
|
||||
ErrorResult rv;
|
||||
mFailureCallback->Call(rv);
|
||||
if (mFailureCallback) {
|
||||
ErrorResult rv;
|
||||
mFailureCallback->Call(rv);
|
||||
}
|
||||
|
||||
mContext->RemoveFromDecodeQueue(this);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ MOCHITEST_FILES := \
|
|||
test_bug808374.html \
|
||||
test_bug827541.html \
|
||||
test_bug839753.html \
|
||||
test_bug845960.html \
|
||||
test_AudioBuffer.html \
|
||||
test_AudioContext.html \
|
||||
test_AudioListener.html \
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Crashtest for bug 845960</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
SpecialPowers.setBoolPref("media.webaudio.enabled", true);
|
||||
(new AudioContext()).decodeAudioData(new ArrayBuffer(0), function() {});
|
||||
ok(true, "Should not crash when the optional failure callback is not specified");
|
||||
SpecialPowers.clearUserPref("media.webaudio.enabled");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче