Commit 66c1cc0f authored by alexc's avatar alexc

aacsbr: Check for illegal values of bs_pointer in sbr_read_grid().


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22380 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0c44313b
......@@ -628,6 +628,8 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
if (ch_data->bs_num_env[1] == 1)
ch_data->bs_amp_res = 0;
ch_data->bs_pointer = 0;
ch_data->bs_freq_res[1] = get_bits1(gb);
for (i = 1; i < ch_data->bs_num_env[1]; i++)
ch_data->bs_freq_res[i + 1] = ch_data->bs_freq_res[1];
......@@ -675,6 +677,12 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
break;
}
if (ch_data->bs_pointer > ch_data->bs_num_env[1] + 1) {
av_log(ac->avccontext, AV_LOG_ERROR,
"Invalid bitstream, bs_pointer points to a middle noise border outside the time borders table: %d\n",
ch_data->bs_pointer);
return -1;
}
if (ch_data->bs_frame_class == FIXFIX && ch_data->bs_num_env[1] > 4) {
av_log(ac->avccontext, AV_LOG_ERROR,
"Invalid bitstream, too many SBR envelopes in FIXFIX type SBR frame: %d\n",
......
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