Commit 2c40b7e7 authored by alexc's avatar alexc

aacsbr: Check that bs_num_env is valid before writing arrays with it as an offset.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22413 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 66fd974b
...@@ -689,7 +689,6 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr, ...@@ -689,7 +689,6 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
num_rel_lead = get_bits(gb, 2); num_rel_lead = get_bits(gb, 2);
num_rel_trail = get_bits(gb, 2); num_rel_trail = get_bits(gb, 2);
ch_data->bs_num_env = num_rel_lead + num_rel_trail + 1; ch_data->bs_num_env = num_rel_lead + num_rel_trail + 1;
ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
if (ch_data->bs_num_env > 5) { if (ch_data->bs_num_env > 5) {
av_log(ac->avccontext, AV_LOG_ERROR, av_log(ac->avccontext, AV_LOG_ERROR,
...@@ -698,6 +697,8 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr, ...@@ -698,6 +697,8 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
return -1; return -1;
} }
ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
for (i = 0; i < num_rel_lead; i++) for (i = 0; i < num_rel_lead; i++)
ch_data->t_env[i + 1] = ch_data->t_env[i] + 2 * get_bits(gb, 2) + 2; ch_data->t_env[i + 1] = ch_data->t_env[i] + 2 * get_bits(gb, 2) + 2;
for (i = 0; i < num_rel_trail; i++) for (i = 0; i < num_rel_trail; i++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment