]> git.sesse.net Git - mlt/commitdiff
fix possible divide by zero (coverity-709344)
authorDan Dennedy <dan@dennedy.org>
Mon, 23 Jul 2012 04:16:02 +0000 (21:16 -0700)
committerDan Dennedy <dan@dennedy.org>
Tue, 24 Jul 2012 05:06:32 +0000 (22:06 -0700)
src/modules/normalize/filter_volume.c

index ad503b7f9c3cfa1231e89d8887e8370be67b9eca..2b294cbe19adf432408c051ca42ad2c04265f7c7 100644 (file)
@@ -100,7 +100,7 @@ static inline double get_smoothed_data( double *buf, int count )
                        j++;
                }
        }
-       smoothed /= j;
+       if (j) smoothed /= j;
 //     fprintf( stderr, "smoothed over %d values, result %f\n", j, smoothed );
 
        return smoothed;