changeset 407:b0b49da13975

Fix uninitialised members
author Chris Cannam
date Wed, 03 Sep 2014 09:25:41 +0100
parents 53fee450891e
children edfdb1d5db3c
files audioio/ClipMixer.cpp
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/audioio/ClipMixer.cpp	Wed Sep 03 09:23:02 2014 +0100
+++ b/audioio/ClipMixer.cpp	Wed Sep 03 09:25:41 2014 +0100
@@ -24,7 +24,10 @@
     m_channels(channels),
     m_sampleRate(sampleRate),
     m_blockSize(blockSize),
-    m_clipData(0)
+    m_clipData(0),
+    m_clipLength(0),
+    m_clipF0(0),
+    m_clipRate(0)
 {
 }
 
@@ -102,7 +105,7 @@
 float
 ClipMixer::getResampleRatioFor(float frequency)
 {
-    if (!m_clipData) return 1.0;
+    if (!m_clipData || !m_clipRate) return 1.0;
     float pitchRatio = m_clipF0 / frequency;
     float resampleRatio = m_sampleRate / m_clipRate;
     return pitchRatio * resampleRatio;