Bug 901527 - Null pointer when resetting a resampler. r=roc, a=akeybl
authorRandell Jesup <rjesup@jesup.org>
Wed, 07 Aug 2013 01:36:03 -0400
changeset 153667 45a87175ba5bc01755b951bb0a682fa19c0aa42f
parent 153666 4887af6999dbeb52e1213d9a14dd5be9e294b1ef
child 153668 b62f2b0fdb9d4519c289d79787b572d9c4e66e9e
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, akeybl
bugs901527
milestone25.0a2
Bug 901527 - Null pointer when resetting a resampler. r=roc, a=akeybl
media/webrtc/trunk/webrtc/common_audio/resampler/resampler.cc
--- a/media/webrtc/trunk/webrtc/common_audio/resampler/resampler.cc
+++ b/media/webrtc/trunk/webrtc/common_audio/resampler/resampler.cc
@@ -69,16 +69,17 @@ int Resampler::ResetIfNeeded(int in_freq
 int Resampler::Reset(int in_freq, int out_freq, ResamplerType type)
 {
   uint32_t channels = (type == kResamplerSynchronousStereo ||
                        type == kResamplerFixedSynchronousStereo) ? 2 : 1;
 
   if (state_)
   {
     speex_resampler_destroy(state_);
+    state_ = NULL;
   }
   type_ = type;
   channels_ = channels;
   in_freq_ = in_freq;
   out_freq_ = out_freq;
 
   // For fixed-rate, same-rate resamples we just memcpy and so don't spin up a resampler
   if (in_freq != out_freq || !IsFixedRate())