[FFmpeg-cvslog] aacpsy: psy_3gpp_analyze_channel() handle energy == 0

Michael Niedermayer git at videolan.org
Fri Sep 14 03:35:45 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Sep 14 03:27:25 2012 +0200| [570931d411235efdefe0339bcab1ea15ae845da6] | committer: Michael Niedermayer

aacpsy: psy_3gpp_analyze_channel() handle energy == 0

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=570931d411235efdefe0339bcab1ea15ae845da6
---

 libavcodec/aacpsy.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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];
         }



More information about the ffmpeg-cvslog mailing list