summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/audio_plot.cc4
-rw-r--r--src/wx/timeline.cc2
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;
}