]> git.sesse.net Git - ffmpeg/commitdiff
aacpsy: calc_reduction_3gpp() handle active_lines = 0
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 14 Sep 2012 01:26:19 +0000 (03:26 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 14 Sep 2012 01:26:19 +0000 (03:26 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/aacpsy.c

index 0d44c00cd259f35a5ab5bc87cf1be802d530608e..93370b8761b83a21b03cfbe42cc3c1d04c1bc140 100644 (file)
@@ -526,6 +526,9 @@ static float calc_reduction_3gpp(float a, float desired_pe, float pe,
 {
     float thr_avg, reduction;
 
+    if(active_lines == 0.0)
+        return 0;
+
     thr_avg   = exp2f((a - pe) / (4.0f * active_lines));
     reduction = exp2f((a - desired_pe) / (4.0f * active_lines)) - thr_avg;