diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-02-05 14:52:23 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-02-05 14:52:23 +0000 |
| commit | d8a2e55855b50eda28ec7d394449274f5e085bd6 (patch) | |
| tree | 9d3110b4c306a80800259b6fd4b9045531e17064 /src/wx | |
| parent | ebe451c248c3accd1a564bcad5eabf9d32a971f3 (diff) | |
Fix some coverity-reported stuff.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/audio_plot.cc | 4 | ||||
| -rw-r--r-- | src/wx/timeline.cc | 2 |
2 files changed, 4 insertions, 2 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)); } diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index 6cc1f79d9..4e306c499 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -474,7 +474,7 @@ void Timeline::setup_pixels_per_time_unit () { shared_ptr<const Film> film = _film.lock (); - if (!film) { + if (!film || film->length() == 0) { return; } |
