summaryrefslogtreecommitdiff
path: root/src/wx/audio_plot.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-02-05 14:52:23 +0000
committerCarl Hetherington <cth@carlh.net>2014-02-05 14:52:23 +0000
commitd8a2e55855b50eda28ec7d394449274f5e085bd6 (patch)
tree9d3110b4c306a80800259b6fd4b9045531e17064 /src/wx/audio_plot.cc
parentebe451c248c3accd1a564bcad5eabf9d32a971f3 (diff)
Fix some coverity-reported stuff.
Diffstat (limited to 'src/wx/audio_plot.cc')
-rw-r--r--src/wx/audio_plot.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc
index f78885772..fd2619255 100644
--- a/src/wx/audio_plot.cc
+++ b/src/wx/audio_plot.cc
@@ -259,7 +259,9 @@ AudioPlot::plot_rms (wxGraphicsPath& path, int channel) const
p += pow (*j, 2);
}
- p = sqrt (p / smoothing.size ());
+ if (smoothing.size() > 0) {
+ p = sqrt (p / smoothing.size ());
+ }
path.AddLineToPoint (_db_label_width + i * _x_scale, y_for_linear (p));
}