Fix for heap buffer overflow in read section data
compare parsed values against array dimensions, since fields can hold larger numbers than the array's are dimensioned to handle. Bug: 112611363 Test: poc Change-Id: I56b1c738cade376a39e8e9c588fc73f9602567f2
This commit is contained in:
parent
b3c5bcb7bd
commit
6d56d0914f
2 changed files with 4 additions and 2 deletions
|
|
@ -28,6 +28,7 @@
|
|||
#define MAX_BINS_LONG 1024
|
||||
#define MAX_BINS_SHORT 128
|
||||
#define MAX_SCALE_FACTOR_BANDS_SHORT 16
|
||||
#define MAX_SCALE_FACTOR_BANDS_LONG (52)
|
||||
|
||||
#define ZERO_HCB 0
|
||||
|
||||
|
|
|
|||
|
|
@ -113,10 +113,11 @@ WORD16 ixheaacd_read_section_data(
|
|||
sect_len_incr = 1;
|
||||
|
||||
sect_len = (sect_len + sect_len_incr);
|
||||
top = (sfb + sect_len);
|
||||
|
||||
if (aac_spect_data_resil_flag) {
|
||||
if (num_lines_sec_idx >= MAX_SFB_HCR) {
|
||||
top = (sfb + sect_len);
|
||||
if ((num_lines_sec_idx >= MAX_SFB_HCR) ||
|
||||
(top >= MAX_SCALE_FACTOR_BANDS_LONG)) {
|
||||
return -1;
|
||||
}
|
||||
ptr_num_sect_lines[num_lines_sec_idx] =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue