Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b875f69d authored by Dan Austin's avatar Dan Austin
Browse files

Enabling fsanitize unsigned-integer-overflow in AMR-NB codecs

Enables fsanitize unsigned integer overflow in the AMR-NB codecs
and disables integer sanitization for the Chebps, sub, and
Syn_filt functions which contain controlled integer overflow
conditions.

Bug: 23110888
Change-Id: I036aa0e94f39e30c2d90be86d9b8f1b169f56245
parent 1d144929
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -69,7 +69,7 @@ LOCAL_CFLAGS := \


LOCAL_CFLAGS += -Werror
LOCAL_CFLAGS += -Werror
LOCAL_CLANG := true
LOCAL_CLANG := true
LOCAL_SANITIZE := signed-integer-overflow
LOCAL_SANITIZE := signed-integer-overflow unsigned-integer-overflow


LOCAL_MODULE := libstagefright_amrnb_common
LOCAL_MODULE := libstagefright_amrnb_common


+3 −1
Original line number Original line Diff line number Diff line
@@ -237,7 +237,9 @@ static Word16 Chebps (Word16 x,


------------------------------------------------------------------------------
------------------------------------------------------------------------------
*/
*/

#ifdef __clang__
__attribute__((no_sanitize("integer")))
#endif
static Word16 Chebps(Word16 x,
static Word16 Chebps(Word16 x,
                     Word16 f[], /* (n) */
                     Word16 f[], /* (n) */
                     Word16 n,
                     Word16 n,
+3 −0
Original line number Original line Diff line number Diff line
@@ -187,6 +187,9 @@ terms listed above has been obtained from the copyright holder.
; FUNCTION CODE
; FUNCTION CODE
----------------------------------------------------------------------------*/
----------------------------------------------------------------------------*/


#ifdef __clang__
__attribute__((no_sanitize("integer")))
#endif
Word16 sub(Word16 var1, Word16 var2, Flag *pOverflow)
Word16 sub(Word16 var1, Word16 var2, Flag *pOverflow)
{
{


+3 −1
Original line number Original line Diff line number Diff line
@@ -245,7 +245,9 @@ void Syn_filt (


------------------------------------------------------------------------------
------------------------------------------------------------------------------
*/
*/

#ifdef __clang__
__attribute__((no_sanitize("integer")))
#endif
void Syn_filt(
void Syn_filt(
    Word16 a[],     /* (i)   : a[M+1] prediction coefficients   (M=10)  */
    Word16 a[],     /* (i)   : a[M+1] prediction coefficients   (M=10)  */
    Word16 x[],     /* (i)   : input signal                             */
    Word16 x[],     /* (i)   : input signal                             */