Closed
Bug 836072
Opened 11 years ago
Closed 11 years ago
Validate the arguments to AudioParam.exponentialRampToValueAtTime() correctly
Categories
(Core :: Web Audio, defect)
Tracking
()
RESOLVED
FIXED
mozilla22
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
Details
Attachments
(1 file)
6.54 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
From the spec: "The value parameter is the value the parameter will exponentially ramp to at the given time. An exception will be thrown if this value is less than or equal to 0, or if the value at the time of the previous event is less than or equal to 0." I have a patch to enforce this.
Assignee | ||
Comment 1•11 years ago
|
||
The spec seems a little ambiguous to me. Wouldn't it make sense to sample the timeline at time T and use that as the starting point for the exponential ramp, and check here that that starting point is positive? That's not what your code does.
Assignee | ||
Comment 3•11 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #2) > The spec seems a little ambiguous to me. Wouldn't it make sense to sample > the timeline at time T and use that as the starting point for the > exponential ramp, and check here that that starting point is positive? > That's not what your code does. No, I don't think that's what you want here. This condition needs to be enforced in order to avoid computing NaNs, which is in fact how I found out that I had previously missed that sentence in the spec.
I do not understand. What exactly does "the time of the previous event" mean in the spec?
Assignee | ||
Comment 5•11 years ago
|
||
I have always taken it to mean the time parameter specified for the previous event. I can file a spec issue in order to clarify this if you want me to.
I don't think the text in comment #0 makes any sense then.
Assignee | ||
Comment 7•11 years ago
|
||
OK, posted a question to the list.
Now that I read your email to the list and re-read the spec, I realize that I'm an idiot.
Comment on attachment 707853 [details] [diff] [review] Patch (v1) Review of attachment 707853 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/media/AudioEventTimeline.h @@ +297,5 @@ > + const Event* previous = nullptr; > + const Event* next = nullptr; > + > + bool bailOut = false; > + for (unsigned i = 0; !bailOut && i < mEvents.Length(); ++i) { Why aren't you iterating from the last event to the first event? Wouldn't that be simpler?
Assignee | ||
Comment 10•11 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #9) > Comment on attachment 707853 [details] [diff] [review] > Patch (v1) > > Review of attachment 707853 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: content/media/AudioEventTimeline.h > @@ +297,5 @@ > > + const Event* previous = nullptr; > > + const Event* next = nullptr; > > + > > + bool bailOut = false; > > + for (unsigned i = 0; !bailOut && i < mEvents.Length(); ++i) { > > Why aren't you iterating from the last event to the first event? Wouldn't > that be simpler? Not sure how that would be simpler. We still need to maintain both the previous and next pointers, and then the logic would be a bit harder to follow, I think. Note that this code is borrowed from GetValueAtTime (I didn't bother refactoring that piece into a helper since GetValueAtTime will go away soon), and reading from backwards there was my first intuition as well, but I then decided that iterating forwards was a bit cleaner.
Comment on attachment 707853 [details] [diff] [review] Patch (v1) Review of attachment 707853 [details] [diff] [review]: ----------------------------------------------------------------- OK!
Attachment #707853 -
Flags: review?(roc) → review+
Assignee | ||
Comment 12•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/6a5dcf166f09
Comment 13•11 years ago
|
||
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/09796dfecc53 for a signed-unsigned comparison.
Assignee | ||
Comment 14•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/cfefa8d06ac0
Comment 15•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/cfefa8d06ac0
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Assignee | ||
Comment 16•11 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.
Description
•