[Webkit-unassigned] [Bug 150925] createChannelMerger and createChannelSplitter should throw INDEX_SIZE_ERR for invalid numberOfInputs value

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 27 21:02:57 PST 2016


--- Comment #3 from Michael Catanzaro <mcatanzaro at igalia.com> ---
Comment on attachment 264849
  --> https://bugs.webkit.org/attachment.cgi?id=264849

View in context: https://bugs.webkit.org/attachment.cgi?id=264849&action=review

Thanks for this patch, Hyemi, and sorry for the delay in getting a review. It looks good, but note that AudioContext::createPeriodicWave has the same problem. r=me if you could fix that too.

> Source/WebCore/Modules/webaudio/AudioContext.cpp:611
> +        ec = INDEX_SIZE_ERR;

Hm, I see that this change is correct, because ChannelSplitterNode::create (and also ChannelMergerNode::create) will only ever fail if the numberOfInputs parameter is invalid. I'm a bit uncomfortable with relying on a null return value from create to signal that, since it's not at all clear from reading AudioContext.cpp why the ExceptionCode should be INDEX_SIZE_ERROR. I was going to ask you to pass the ExceptionCode down into the create function, but I see this pattern is established throughout AudioContext.cpp, so the code you have here is best.

> LayoutTests/webaudio/audiochannelmerger-basic-expected.txt:6
> +PASS IndexSizeError was thrown for numberOfInputs > 32.

Ah, I see 32 is valid; good catch. I would mention this fix separately in the changelog, since it is noteworthy.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160128/7c5cd4e8/attachment-0001.html>

More information about the webkit-unassigned mailing list