summaryrefslogtreecommitdiffstats
path: root/libavcodec/aacpsy.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-09-14 03:27:25 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-09-14 03:27:25 +0200
commit570931d411235efdefe0339bcab1ea15ae845da6 (patch)
tree4708655c04043e837c7315e65411544335b1e896 /libavcodec/aacpsy.c
parent413b32f80890bd6dd8820098c88f632842973d7e (diff)
downloadffmpeg-streaming-570931d411235efdefe0339bcab1ea15ae845da6.zip
ffmpeg-streaming-570931d411235efdefe0339bcab1ea15ae845da6.tar.gz
aacpsy: psy_3gpp_analyze_channel() handle energy == 0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/aacpsy.c')
-rw-r--r--libavcodec/aacpsy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c
index 93370b8..fa562b3 100644
--- a/libavcodec/aacpsy.c
+++ b/libavcodec/aacpsy.c
@@ -588,7 +588,7 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
form_factor += sqrtf(fabs(coefs[start+i]));
}
band->thr = band->energy * 0.001258925f;
- band->nz_lines = form_factor / powf(band->energy / band_sizes[g], 0.25f);
+ band->nz_lines = band->energy>0 ? form_factor / powf(band->energy / band_sizes[g], 0.25f) : 0;
start += band_sizes[g];
}
OpenPOWER on IntegriCloud