diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-12-07 15:32:54 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-12-10 20:11:46 +0100 |
commit | 1d0817d56b66797118880358ea7d7a2acfdca429 (patch) | |
tree | ed3f1bf36e357e855908d40fb7a10885b51f85c1 | |
parent | 2adfb10921668f01eb4c3e08ce57375be6d084de (diff) | |
download | ffmpeg-1d0817d56b66797118880358ea7d7a2acfdca429.tar.gz |
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@niedermayer.cc>
-rw-r--r-- | libavcodec/amrwbdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c index 57aed874cc..7f2874d35f 100644 --- a/libavcodec/amrwbdec.c +++ b/libavcodec/amrwbdec.c @@ -611,7 +611,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); } /** |