Convolver should throw NotSupportedError for invalid channel count

RESOLVED FIXED in Firefox 60

Status

()

defect
P3
normal
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: toy.raymond, Assigned: padenot)

Tracking

({dev-doc-complete})

57 Branch
mozilla60
Points:
---

Firefox Tracking Flags

(firefox58 wontfix, firefox59 wontfix, firefox60 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

a year ago
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.106 Safari/537.36

Steps to reproduce:

Run this:

c = new AudioContext();
b = new AudioBuffer({length: 1, numberOfChannels: 3, sampleRate: c.sampleRate});
n = new ConvolverNode(c)
n.buffer = b


Actual results:

A SyntaxError is thrown when setting the buffer to b.


Expected results:

A NotSupportedError must be thrown: https://webaudio.github.io/web-audio-api/#dom-convolvernode-buffer
Hi toy.raymond,

Did you run this script in Browser Console?
Flags: needinfo?(toy.raymond)
Copy from the spec:
"The AudioBuffer MUST have 1, 2, or 4 channels or a NotSupportedError exception MUST be thrown."
Status: UNCONFIRMED → NEW
Component: Untriaged → Web Audio
Ever confirmed: true
Flags: needinfo?(toy.raymond)
Priority: -- → P3
Product: Firefox → Core
This is reproducible also on Mac OS X 10.12 with FF 58 and FF Nightly 60.0a1(2018-03-07).
OS: Unspecified → All
Hardware: Unspecified → All

Comment 5

a year ago
mozreview-review
Comment on attachment 8957114 [details]
Bug 1443228 - Make the ConvolverNode ctor throw NotSupportedError when passed a buffer with an invalid channel count.

https://reviewboard.mozilla.org/r/226054/#review232168
Attachment #8957114 - Flags: review?(karlt) → review+

Comment 6

a year ago
Pushed by paul@paul.cx:
https://hg.mozilla.org/integration/autoland/rev/0a5ec71513a7
Make the ConvolverNode ctor throw NotSupportedError when passed a buffer with an invalid channel count. r=karlt

Comment 7

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/0a5ec71513a7
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
I've added details about the NotSupportedError to the constructor ref page:

https://developer.mozilla.org/en-US/docs/Web/API/ConvolverNode/ConvolverNode#Exceptions

I've also added a note to the Fx60 rel notes:

https://developer.mozilla.org/en-US/Firefox/Releases/60#Media_and_WebRTC

Let me know if this looks OK. Thanks!
Flags: needinfo?(padenot)
(Assignee)

Comment 9

a year ago
Perfect as usual, Chris, thanks!
Flags: needinfo?(padenot)
You need to log in before you can comment on or make changes to this bug.