Fix rooting hazards in Web Audio code

RESOLVED FIXED in mozilla23

Status

()

Core
Web Audio
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Ehsan, Assigned: Ehsan)

Tracking

Trunk
mozilla23
x86
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Comment hidden (empty)
(Assignee)

Comment 1

5 years ago
Created attachment 745571 [details] [diff] [review]
Patch (v1)
Attachment #745571 - Flags: review?(tschneidereit)
(Assignee)

Updated

5 years ago
Blocks: 779297
(Assignee)

Comment 2

5 years ago
Created attachment 745582 [details] [diff] [review]
Patch (v2)
Attachment #745571 - Attachment is obsolete: true
Attachment #745571 - Flags: review?(tschneidereit)
Attachment #745582 - Flags: review?(tschneidereit)
Comment on attachment 745582 [details] [diff] [review]
Patch (v2)

Review of attachment 745582 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the return value checks added.

::: content/media/webaudio/AudioBuffer.cpp
@@ +99,5 @@
>        const float* data = mSharedChannels->GetData(i);
>        // The following code first zeroes the array and then copies our data
>        // into it. We could avoid this with additional JS APIs to construct
>        // an array (or ArrayBuffer) containing initial data.
> +      JS::RootedObject array(aJSContext, JS_NewFloat32Array(aJSContext, mLength));

Damn, missed this earlier. JS_NewFloat32Array can return NULL, so please check the result here, too.

@@ +137,5 @@
>  {
>    RestoreJSChannelData(aJSContext);
>  
>    MOZ_ASSERT(aChannel < NumberOfChannels());
> +  JS::RootedObject arrayBuffer(aJSContext, JS_NewArrayBufferWithContents(aJSContext, aContents));

And this, too.

@@ +142,1 @@
>    mJSChannels[aChannel] = JS_NewFloat32ArrayWithBuffer(aJSContext, arrayBuffer,

And this.
Attachment #745582 - Flags: review?(tschneidereit) → review+
https://hg.mozilla.org/mozilla-central/rev/e6d7033aeb74
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
(Assignee)

Comment 6

5 years ago
Mass moving Web Audio bugs to the Web Audio component.  Filter on duckityduck.
Component: Video/Audio → Web Audio
You need to log in before you can comment on or make changes to this bug.