mirror of https://github.com/mstorsjo/fdk-aac.git
Avoid undefined shift exponent in f2Pow().
Bug: 146938418 Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: Id28608e049244968158900848c23bf7a8298083d
This commit is contained in:
parent
cee316ab3e
commit
e323bf6cab
|
@ -775,7 +775,7 @@ FIXP_DBL fPow(FIXP_DBL base_m, INT base_e, FIXP_DBL exp_m, INT exp_e,
|
|||
|
||||
/**
|
||||
* \brief return (base_m * 2^base_e) ^ N
|
||||
* \param base_m mantissa of the base
|
||||
* \param base_m mantissa of the base. Must not be negative.
|
||||
* \param base_e exponent of the base
|
||||
* \param N power to be calculated of the base
|
||||
* \param result_e pointer to a INT where the exponent of the result will be
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue