avfilter/avf_showfreqs: Use floating point division in WFUNC_BHANN
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 3 Sep 2015 12:39:08 +0000 (14:39 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 3 Sep 2015 16:54:14 +0000 (18:54 +0200)
Fixes: CID1322365

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavfilter/avf_showfreqs.c

index a1ef0bf..cbbf040 100644 (file)
@@ -208,7 +208,7 @@ static void generate_window_func(float *lut, int N, int win_func, float *overlap
         break;
     case WFUNC_BHANN:
         for (n = 0; n < N; n++)
-            lut[n] = 0.62-0.48*FFABS(n/(N-1)-.5)-0.38*cos(2*M_PI*n/(N-1));
+            lut[n] = 0.62-0.48*FFABS(n/(double)(N-1)-.5)-0.38*cos(2*M_PI*n/(N-1));
         *overlap = 0.5;
         break;
     case WFUNC_SINE: