Bug 1137169 - Uninitialised value uses related to mozilla::dom::WebAudioUtils::SpeexResamplerProcess. r=rjesup.
authorJulian Seward <jseward@acm.org>
Wed, 08 Jul 2015 20:11:52 +0200
changeset 251947 14c4e4aded9f739bb95260022dcbc92faecc7326
parent 251946 0e8193deffea7398e18582afa0349f984fd7e8e0
child 251948 64077f01ac1650c87831986897ac6c13057405e3
push id62012
push userjseward@mozilla.com
push dateWed, 08 Jul 2015 21:36:48 +0000
treeherdermozilla-inbound@14c4e4aded9f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrjesup
bugs1137169
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1137169 - Uninitialised value uses related to mozilla::dom::WebAudioUtils::SpeexResamplerProcess. r=rjesup.
media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -1368,21 +1368,21 @@ NotifyPull(MediaStreamGraph* graph, Stre
             samples_length);
 
     if (err != kMediaConduitNoError) {
       // Insert silence on conduit/GIPS failure (extremely unlikely)
       MOZ_MTLOG(ML_ERROR, "Audio conduit failed (" << err
                 << ") to return data @ " << played_ticks_
                 << " (desired " << desired_time << " -> "
                 << source_->StreamTimeToSeconds(desired_time) << ")");
-      samples_length = (track_rate_/100)*sizeof(uint16_t); // if this is not enough we'll loop and provide more
-      memset(samples_data, '\0', samples_length);
+      samples_length = track_rate_/100; // if this is not enough we'll loop and provide more
+      memset(samples_data, '\0', samples_length * sizeof(uint16_t));
     }
 
-    MOZ_ASSERT(samples_length < AUDIO_SAMPLE_BUFFER_MAX);
+    MOZ_ASSERT(samples_length * sizeof(uint16_t) < AUDIO_SAMPLE_BUFFER_MAX);
 
     MOZ_MTLOG(ML_DEBUG, "Audio conduit returned buffer of length "
               << samples_length);
 
     AudioSegment segment;
     nsAutoTArray<const int16_t*,1> channels;
     channels.AppendElement(samples_data);
     segment.AppendFrames(samples.forget(), channels, samples_length);