Fix some coverity-reported stuff.
[dcpomatic.git] / src / wx / audio_plot.cc
index f78885772ce033e682a1e9d178d85c93441b2b45..fd261925518b3c058605bf4f04951895e073ec2f 100644 (file)
@@ -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));
        }