diff options
author | Marco Nelissen <marcone@google.com> | 2015-12-08 12:39:45 -0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2015-12-26 03:56:55 -0800 |
commit | efa19aba6cdc191237c9e9b123714bba8151c591 (patch) | |
tree | 2dd3c7daf69b9324122f05cd3aa3ebf5ad159919 /media/libstagefright/codecs/amrwbenc/src/c2t64fx.c | |
parent | 54cdb1f0ce7d03a75499d5ae258fd278de27462d (diff) | |
download | frameworks_av-efa19aba6cdc191237c9e9b123714bba8151c591.zip frameworks_av-efa19aba6cdc191237c9e9b123714bba8151c591.tar.gz frameworks_av-efa19aba6cdc191237c9e9b123714bba8151c591.tar.bz2 |
Fix overflows in amrwbenc
Revert 3cdaed88daeeebfe05e7913837f41c2d92f411cc and
883ff4f4c41ae9bf84d1912ab054fe38f7505dd0, and fix the overflows that
should have been clamped instead of allowed to overflow.
Bug: 25843966
Bug: 23752600
Change-Id: I9af1726d058eb8eeaa80fa8df74fe0a3759486c1
Diffstat (limited to 'media/libstagefright/codecs/amrwbenc/src/c2t64fx.c')
-rw-r--r-- | media/libstagefright/codecs/amrwbenc/src/c2t64fx.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/media/libstagefright/codecs/amrwbenc/src/c2t64fx.c b/media/libstagefright/codecs/amrwbenc/src/c2t64fx.c index 18698e2..519924d 100644 --- a/media/libstagefright/codecs/amrwbenc/src/c2t64fx.c +++ b/media/libstagefright/codecs/amrwbenc/src/c2t64fx.c @@ -80,6 +80,9 @@ void ACELP_2t64_fx( Isqrt_n(&s, &exp); s = L_shl(s, add1(exp, 5)); + if (s > INT_MAX - 0x8000) { + s = INT_MAX - 0x8000; + } k_cn = vo_round(s); /* set k_dn = 32..512 (ener_dn = 2^30..2^22) */ |