diff mbox series

[FFmpeg-devel,2/3] avcodec/aacpsy: Avoid floating point division by 0 of norm_fac

Message ID 20210528184834.4625-2-michael@niedermayer.cc
State Accepted
Commit 223b5e8ac9f6461bb13ed365419ec485c5b2b002
Headers show
Series [FFmpeg-devel,1/3] avcodec/ratecontrol: Avoid floating point division by 0 of mb_num | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Michael Niedermayer May 28, 2021, 6:48 p.m. UTC
Fixes: Ticket7995
Fixes: CVE-2020-20446

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/aacpsy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer May 29, 2021, 4:07 p.m. UTC | #1
On Fri, May 28, 2021 at 08:48:33PM +0200, Michael Niedermayer wrote:
> Fixes: Ticket7995
> Fixes: CVE-2020-20446
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/aacpsy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
diff mbox series

Patch

diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c
index 482113d427..e51d29750b 100644
--- a/libavcodec/aacpsy.c
+++ b/libavcodec/aacpsy.c
@@ -794,7 +794,7 @@  static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
 
         if (pe < 1.15f * desired_pe) {
             /* 6.6.1.3.6 "Final threshold modification by linearization" */
-            norm_fac = 1.0f / norm_fac;
+            norm_fac = norm_fac ? 1.0f / norm_fac : 0;
             for (w = 0; w < wi->num_windows*16; w += 16) {
                 for (g = 0; g < num_bands; g++) {
                     AacPsyBand *band = &pch->band[w+g];