X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fwx%2Faudio_plot.cc;h=0868d931a8be1d38dc7b95e0c154afce4e544a51;hb=8aeb741ccbe2edb528e98a431bf55459a6836a9b;hp=96de34d406744960db60c4aa072a0673699c9c2d;hpb=4ba8772aef261da209bbb882325fd61a8b479fd7;p=dcpomatic.git diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc index 96de34d40..0868d931a 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)); }