From 413b32f80890bd6dd8820098c88f632842973d7e Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 14 Sep 2012 03:26:19 +0200 Subject: [PATCH] aacpsy: calc_reduction_3gpp() handle active_lines = 0 Signed-off-by: Michael Niedermayer --- libavcodec/aacpsy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c index 0d44c00cd2..93370b8761 100644 --- a/libavcodec/aacpsy.c +++ b/libavcodec/aacpsy.c @@ -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;