Closed
Bug 1232326
Opened 10 years ago
Closed 10 years ago
Uninitialised value use in AudioBufferInPlaceScale
Categories
(Core :: Web Audio, defect)
Core
Web Audio
Tracking
()
RESOLVED
FIXED
mozilla46
People
(Reporter: jseward, Unassigned)
References
Details
Attachments
(2 files)
|
6.68 KB,
text/plain
|
Details | |
|
952 bytes,
patch
|
dminor
:
review+
|
Details | Diff | Splinter Review |
dom/media/webaudio/AudioNodeEngine.cpp: AudioBufferInPlaceScale() is
passed an undefined |aScale| value from
PeriodicWave::createBandLimitedTables().
This seems to be because PeriodicWave::PeriodicWave does not
initialise m_normalizationScale. Setting it to 1.0f in the
constructor makes the Valgrind complaints go away.
On closer inspection, m_normalizationScale seems almost completely
unused. It only has liveness within a single call to
PeriodicWave::createBandLimitedTables and so it would be equally
possible and maybe better, to remove it as a class field and replace
the single use with an auto variable in
PeriodicWave::createBandLimitedTables.
| Reporter | ||
Comment 1•10 years ago
|
||
(In reply to Julian Seward [:jseward] from comment #0)
> On closer inspection, m_normalizationScale seems almost completely
> unused. It only has liveness within a single call to
> PeriodicWave::createBandLimitedTables [..]
Ah, no, I am wrong. It could be that there are two calls to
PeriodicWave::createBandLimitedTables on the same object. The first
can set m_normalizationScale and the second might use it.
At least, removing m_normalizationScale and using an auto scalar
as suggested in comment 0, causes the test to fail.
| Reporter | ||
Comment 2•10 years ago
|
||
STR:
DISPLAY=:1.0 MOZ_DISABLE_NONLOCAL_CONNECTIONS=0 \
./mach mochitest -f plain --valgrind=vMOZHX \
"--valgrind-args=--fullpath-after=CURR/ --track-origins=no" \
dom/media/webaudio/test/test_periodicWaveBandLimiting.html
| Reporter | ||
Comment 3•10 years ago
|
||
| Reporter | ||
Comment 4•10 years ago
|
||
Sets m_normalizationScale to 1.0f in PeriodicWave::PeriodicWave.
I don't know if 1.0 is a suitable initial value, but it seems
plausible and it doesn't cause the test
dom/media/webaudio/test/test_periodicWaveBandLimiting.html
to fail.
| Reporter | ||
Updated•10 years ago
|
Attachment #8698056 -
Flags: review?(dminor)
Comment 5•10 years ago
|
||
Comment on attachment 8698056 [details] [diff] [review]
bug1232326-1.diff
Review of attachment 8698056 [details] [diff] [review]:
-----------------------------------------------------------------
This is fine. The value will be set to a proper value when we detect that it's necessary to rebuild the band limited tables in waveDataForFundamentalFrequency.
Attachment #8698056 -
Flags: review?(dminor) → review+
Comment 7•10 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox46:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in
before you can comment on or make changes to this bug.
Description
•