An early return from updateSchedulingInfo can leave some variables uninitialized.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Nov 2018 19:06:35 +0000 (19:06 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Nov 2018 19:06:35 +0000 (19:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191755
<rdar://problem/39910089>

Reviewed by Brent Fulgham.

* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::process):
* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::updateSchedulingInfo):
* Modules/webaudio/OscillatorNode.cpp:
(WebCore::OscillatorNode::process):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238291 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp
Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp
Source/WebCore/Modules/webaudio/OscillatorNode.cpp

index 4ee6b56..ac137d8 100644 (file)
@@ -1,3 +1,18 @@
+2018-11-16  Jer Noble  <jer.noble@apple.com>
+
+        An early return from updateSchedulingInfo can leave some variables uninitialized.
+        https://bugs.webkit.org/show_bug.cgi?id=191755
+        <rdar://problem/39910089>
+
+        Reviewed by Brent Fulgham.
+
+        * Modules/webaudio/AudioBufferSourceNode.cpp:
+        (WebCore::AudioBufferSourceNode::process):
+        * Modules/webaudio/AudioScheduledSourceNode.cpp:
+        (WebCore::AudioScheduledSourceNode::updateSchedulingInfo):
+        * Modules/webaudio/OscillatorNode.cpp:
+        (WebCore::OscillatorNode::process):
+
 2018-11-16  Alicia Boya GarcĂ­a  <aboya@igalia.com>
 
         [MSE][GStreamer] Ignore caps notifications when tearing down the pipeline
index fbd2b63..b02515c 100644 (file)
@@ -111,8 +111,8 @@ void AudioBufferSourceNode::process(size_t framesToProcess)
         return;
     }
 
-    size_t quantumFrameOffset;
-    size_t bufferFramesToProcess;
+    size_t quantumFrameOffset = 0;
+    size_t bufferFramesToProcess = 0;
     updateSchedulingInfo(framesToProcess, outputBus, quantumFrameOffset, bufferFramesToProcess);
 
     if (!bufferFramesToProcess) {
index e00ca55..28e3682 100644 (file)
@@ -53,6 +53,9 @@ AudioScheduledSourceNode::AudioScheduledSourceNode(AudioContext& context, float
 
 void AudioScheduledSourceNode::updateSchedulingInfo(size_t quantumFrameSize, AudioBus& outputBus, size_t& quantumFrameOffset, size_t& nonSilentFramesToProcess)
 {
+    nonSilentFramesToProcess = 0;
+    quantumFrameOffset = 0;
+
     ASSERT(quantumFrameSize == AudioNode::ProcessingSizeInFrames);
     if (quantumFrameSize != AudioNode::ProcessingSizeInFrames)
         return;
@@ -75,7 +78,6 @@ void AudioScheduledSourceNode::updateSchedulingInfo(size_t quantumFrameSize, Aud
     if (m_playbackState == UNSCHEDULED_STATE || m_playbackState == FINISHED_STATE || startFrame >= quantumEndFrame) {
         // Output silence.
         outputBus.zero();
-        nonSilentFramesToProcess = 0;
         return;
     }
 
index c7e90e8..05a013f 100644 (file)
@@ -205,8 +205,8 @@ void OscillatorNode::process(size_t framesToProcess)
         return;
     }
 
-    size_t quantumFrameOffset;
-    size_t nonSilentFramesToProcess;
+    size_t quantumFrameOffset = 0;
+    size_t nonSilentFramesToProcess = 0;
     updateSchedulingInfo(framesToProcess, outputBus, quantumFrameOffset, nonSilentFramesToProcess);
 
     if (!nonSilentFramesToProcess) {
@@ -231,7 +231,7 @@ void OscillatorNode::process(size_t framesToProcess)
     float frequency = 0;
     float* higherWaveData = nullptr;
     float* lowerWaveData = nullptr;
-    float tableInterpolationFactor;
+    float tableInterpolationFactor = 0;
 
     if (!hasSampleAccurateValues) {
         frequency = m_frequency->smoothedValue();