aboutsummaryrefslogtreecommitdiffstats
path: root/libFDK/src
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2019-11-13 16:09:45 +0100
committerJean-Michel Trivi <jmtrivi@google.com>2020-01-22 11:59:08 -0800
commite323bf6cabad6cafd31fc77c4d8c14bb48ea71e1 (patch)
treecabf9349a55b8c748dc5771863b01feab219f7bd /libFDK/src
parentcee316ab3ebde92047b5e76d15c00768b92cb890 (diff)
downloadfdk-aac-e323bf6cabad6cafd31fc77c4d8c14bb48ea71e1.tar.gz
fdk-aac-e323bf6cabad6cafd31fc77c4d8c14bb48ea71e1.tar.bz2
fdk-aac-e323bf6cabad6cafd31fc77c4d8c14bb48ea71e1.zip
Avoid undefined shift exponent in f2Pow().
Bug: 146938418 Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: Id28608e049244968158900848c23bf7a8298083d
Diffstat (limited to 'libFDK/src')
-rw-r--r--libFDK/src/fixpoint_math.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libFDK/src/fixpoint_math.cpp b/libFDK/src/fixpoint_math.cpp
index 6c656fa..1e26420 100644
--- a/libFDK/src/fixpoint_math.cpp
+++ b/libFDK/src/fixpoint_math.cpp
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
+© Copyright 1995 - 2020 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
@@ -650,6 +650,12 @@ FIXP_DBL fPow(FIXP_DBL base_m, INT base_e, FIXP_DBL exp_m, INT exp_e,
INT ans_lg2_e, baselg2_e;
FIXP_DBL base_lg2, ans_lg2, result;
+ if (base_m <= (FIXP_DBL)0) {
+ result = (FIXP_DBL)0;
+ *result_e = 0;
+ return result;
+ }
+
/* Calc log2 of base */
base_lg2 = fLog2(base_m, base_e, &baselg2_e);