[FFmpeg-cvslog] avcodec/amrwbdec: Fix division by 0 in voice_factor()
Michael Niedermayer
git at videolan.org
Thu Feb 1 01:52:21 EET 2018
ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Thu Dec 7 15:32:54 2017 +0100| [f4cce67dca66c763997e7df02518aa439f2f4424] | committer: Michael Niedermayer
avcodec/amrwbdec: Fix division by 0 in voice_factor()
The added value matches "Digital cellular telecommunications system (Phase 2+) (GSM); Universal Mobile Telecommunications System (UMTS); LTE; Extended Adaptive Multi-Rate - Wideband (AMR-WB+) codec; Floating-point ANSI-C code (3GPP TS 26.304 version 14.0.0 Release 14)
Extended Adaptive Multi-Rate - Wideband (AMR-WB+) codec; Floating-point ANSI-C code"
Fixes: runtime error: division by zero
Fixes: 4415/clusterfuzz-testcase-minimized-4677752314658816
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 1d0817d56b66797118880358ea7d7a2acfdca429)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f4cce67dca66c763997e7df02518aa439f2f4424
---
libavcodec/amrwbdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index c7a99ad320..d5e0431f30 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -614,7 +614,7 @@ static float voice_factor(float *p_vector, float p_gain,
AMRWB_SFR_SIZE) *
f_gain * f_gain;
- return (p_ener - f_ener) / (p_ener + f_ener);
+ return (p_ener - f_ener) / (p_ener + f_ener + 0.01);
}
/**
More information about the ffmpeg-cvslog
mailing list