webrtc/modules/audio_coding/codecs/isac/fix/source
Sam Zackrisson 184da528a7 Fix ASAN bug in iSAC codec
There is a value missing in an array, causing indexing to sometimes be off by one.
The result is never used anyway, so the "solution" is to insert an extra zero at the end.

Details:

In an old refactoring CL, the corresponding array in the floating point version of iSAC is declared with 578 elements, the fixed point version has 577.
See WebRtcIsac_kQKltCodeLenShape:
https://webrtc-codereview.appspot.com/548004/patch/10002/11005
Perhaps the entire array was not carried over to fixed point.

However, the floating point version does not actually have 578 elements in its definition, it has 568. The remaining 10 elements are initialized to 0. So there is no value to use from there, and using a zero instead will mimic the behavior of the floating point code.


Use of the value:
WebRtcIsacfix_kCodeLenShapeQ11 is only accessed in one place [0].
The value sumQQ is set to is only used to compute the BitsQQ,
which is only used to populate the sizeQ11 param of EstCodeLpcCoef,
which is never used anywhere. Not within EstCodeLpcCoef, not within the calling function WebRtcIsacfix_EncodeLpc [1], not in the calling function's calling function [2]. Then it falls out of scope.

[0] https://cs.chromium.org/chromium/src/third_party/webrtc/modules/audio_coding/codecs/isac/fix/source/entropy_coding.c?l=1223&rcl=3c4fda2ed8140a330634c0a2704a3cf0311a89de
[1] https://cs.chromium.org/chromium/src/third_party/webrtc/modules/audio_coding/codecs/isac/fix/source/entropy_coding.c?l=1468&rcl=3c4fda2ed8140a330634c0a2704a3cf0311a89de
[2] https://cs.chromium.org/chromium/src/third_party/webrtc/modules/audio_coding/codecs/isac/fix/source/encode.c?l=214&rcl=3c4fda2ed8140a330634c0a2704a3cf0311a89de

Tested: Instructions in linked bug. No longer repro after applying this CL.
Bug: webrtc:10584
Change-Id: I87a90e8cf58d82f615217e05ea401d3259887769
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161942
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30065}
2019-12-11 15:59:14 +00:00
..
arith_routines.c Using fully qualified #include paths in isac code. 2018-02-01 14:57:44 +00:00
arith_routines_hist.c Using fully qualified #include paths in isac code. 2018-02-01 14:57:44 +00:00
arith_routines_logist.c Using fully qualified #include paths in isac code. 2018-02-01 14:57:44 +00:00
arith_routins.h Reformat the WebRTC code base 2018-06-19 14:00:39 +00:00
audio_decoder_isacfix.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
audio_encoder_isacfix.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
bandwidth_estimator.c Delete isac GetBandwidthInfo/SetBandwidthInfo 2019-09-20 13:53:52 +00:00
bandwidth_estimator.h Delete isac GetBandwidthInfo/SetBandwidthInfo 2019-09-20 13:53:52 +00:00
codec.h Delete dead code inside #ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED 2019-09-20 07:40:10 +00:00
decode.c Using fully qualified #include paths in isac code. 2018-02-01 14:57:44 +00:00
decode_bwe.c Using fully qualified #include paths in isac code. 2018-02-01 14:57:44 +00:00
decode_plc.c Using fully qualified #include paths in isac code. 2018-02-01 14:57:44 +00:00
encode.c Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
entropy_coding.c Using fully qualified #include paths in isac code. 2018-02-01 14:57:44 +00:00
entropy_coding.h Reformat the WebRTC code base 2018-06-19 14:00:39 +00:00
entropy_coding_mips.c Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
entropy_coding_neon.c Using fully qualified #include paths in isac code. 2018-02-01 14:57:44 +00:00
fft.c Using fully qualified #include paths in isac code. 2018-02-01 14:57:44 +00:00
fft.h Reformat the WebRTC code base 2018-06-19 14:00:39 +00:00
filterbank_internal.h Delete root header file typedef.h. 2018-07-25 14:59:26 +00:00
filterbank_tables.c Using fully qualified #include paths in isac code. 2018-02-01 14:57:44 +00:00
filterbank_tables.h Delete root header file typedef.h. 2018-07-25 14:59:26 +00:00
filterbanks.c Delete dead code inside #ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED 2019-09-20 07:40:10 +00:00
filterbanks_mips.c Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
filterbanks_neon.c Add missing header include for filterbanks_neon.c 2018-04-21 18:21:44 +00:00
filterbanks_unittest.cc Fully qualify googletest symbols. 2019-04-09 17:18:20 +00:00
filters.c Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
filters_mips.c Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
filters_neon.c Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
filters_unittest.cc Fully qualify googletest symbols. 2019-04-09 17:18:20 +00:00
initialize.c Using fully qualified #include paths in isac code. 2018-02-01 14:57:44 +00:00
isac_fix_type.h Delete AudioDecoder method IncomingPacket 2019-09-24 08:30:24 +00:00
isacfix.c Delete isac GetBandwidthInfo/SetBandwidthInfo 2019-09-20 13:53:52 +00:00
lattice.c Ignore overflowing left shift 2018-04-19 21:22:49 +00:00
lattice_armv7.S Move asm_defines.h to rtc_base/system/ 2018-03-22 03:12:13 +00:00
lattice_c.c Delete root header file typedef.h. 2018-07-25 14:59:26 +00:00
lattice_mips.c Add missing include of stdint.h in MIPS code. 2018-07-26 11:30:19 +00:00
lattice_neon.c Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
lpc_masking_model.c Using fully qualified #include paths in isac code. 2018-02-01 14:57:44 +00:00
lpc_masking_model.h Reformat the WebRTC code base 2018-06-19 14:00:39 +00:00
lpc_masking_model_mips.c Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
lpc_masking_model_unittest.cc Format almost everything. 2019-07-08 13:45:15 +00:00
lpc_tables.c Fix ASAN bug in iSAC codec 2019-12-11 15:59:14 +00:00
lpc_tables.h Fix ASAN bug in iSAC codec 2019-12-11 15:59:14 +00:00
pitch_estimator.c Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
pitch_estimator.h Reformat the WebRTC code base 2018-06-19 14:00:39 +00:00
pitch_estimator_c.c Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
pitch_estimator_mips.c Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
pitch_filter.c Change the type of indW32 back to int32_t 2018-12-11 13:10:12 +00:00
pitch_filter_armv6.S Move asm_defines.h to rtc_base/system/ 2018-03-22 03:12:13 +00:00
pitch_filter_c.c Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
pitch_filter_mips.c Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
pitch_gain_tables.c Using fully qualified #include paths in isac code. 2018-02-01 14:57:44 +00:00
pitch_gain_tables.h Delete root header file typedef.h. 2018-07-25 14:59:26 +00:00
pitch_lag_tables.c Using fully qualified #include paths in isac code. 2018-02-01 14:57:44 +00:00
pitch_lag_tables.h Delete root header file typedef.h. 2018-07-25 14:59:26 +00:00
settings.h Reformat the WebRTC code base 2018-06-19 14:00:39 +00:00
spectrum_ar_model_tables.c Using fully qualified #include paths in isac code. 2018-02-01 14:57:44 +00:00
spectrum_ar_model_tables.h Delete root header file typedef.h. 2018-07-25 14:59:26 +00:00
structs.h Delete dead code inside #ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED 2019-09-20 07:40:10 +00:00
transform.c Untangle fft third party lib from dependon WebRTC 2018-07-26 13:44:30 +00:00
transform_mips.c Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
transform_neon.c Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
transform_tables.c Delete root header file typedef.h. 2018-07-25 14:59:26 +00:00
transform_unittest.cc Initialize signal processing function pointers statically 2019-06-28 14:20:03 +00:00