Closed Bug 1216081 Opened 5 years ago Closed 5 years ago

OscillatorNodeEngine::mFinalFrequency is used uninitialised

Categories

(Core :: Web Audio, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: jseward, Unassigned)

Details

Attachments

(2 files)

This might be fallout from bug 1209904.  That introduces the following
fragment

+    if (finalFrequency != mFinalFrequency) {
+      mFinalFrequency = finalFrequency;
+      return true;
+    }

but the problem is that OscillatorNodeEngine::OscillatorNodeEngine
doesn't give an initial value for mFinalFrequency, so the |if| condition
is undefined.

Comparing OscillatorNodeEngine::OscillatorNodeEngine with the list of
fields starting at OscillatorNode.cpp:382, it seems as if it has been
the intention of the constructor to initialise all fields, but that
both mFinalFrequency and mPhaseIncrement were forgotten about.
STR: with an --enable-valgrind --disable-jemalloc build, run

./mach mochitest --valgrind=/usr/bin/valgrind \
   dom/media/webaudio/test/test_delayNodeTailWithDisconnect.html
Attached file Valgrind complaint
Comment on attachment 8675590 [details] [diff] [review]
Initialise all fields in the constructor of OscillatorNodeEngine

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

Thanks !
Attachment #8675590 - Flags: review?(padenot) → review+
https://hg.mozilla.org/mozilla-central/rev/4aa9e709ddf7
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.