|
From: Lasse Kärkkäi. <tr...@us...> - 2011-01-20 10:35:05
|
Module: editor
Branch: master
Commit: 85ab78d206f7f645b726515b5f8c6fdfe7e60b67
Author: Lasse Karkkainen <tro...@tr...>
Date: Thu Jan 20 11:33:46 2011 +0100
Fix the segfault
---
pitch.hh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pitch.hh b/pitch.hh
index eb1327e..e3fdfe0 100644
--- a/pitch.hh
+++ b/pitch.hh
@@ -84,7 +84,7 @@ public:
/** Get the peak level in dB (negative value, 0.0 means clipping, sometimes clipping may occur at lower levels too). **/
double getLevel() const { return 10.0 * log10(m_level); }
/** Get a list of all tones detected. **/
- Tones const& getTones() const { return m_moments.back().m_tones; /* FIXME */ }
+ Tones getTones() const { return m_moments.empty() ? Tones() : m_moments.back().m_tones; /* FIXME */ }
/** Find a tone within the singing range; prefers strong tones around 200-400 Hz. **/
//Tone const* findTone(double minfreq = 70.0, double maxfreq = 700.0) const;
std::string const& getId() const { return m_id; }
|