Commit e9a38806 authored by James Almer's avatar James Almer

Merge commit 'ba30b746'

* commit 'ba30b746':
  aac: Validate the sbr sample rate before using the value

See cf5f4c51Merged-by: 's avatarJames Almer <jamrial@gmail.com>
parents b02b43a8 ba30b746
......@@ -261,13 +261,6 @@ static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr,
const int8_t *sbr_offset_ptr;
int16_t stop_dk[13];
if (sbr->sample_rate < 32000) {
temp = 3000;
} else if (sbr->sample_rate < 64000) {
temp = 4000;
} else
temp = 5000;
switch (sbr->sample_rate) {
case 16000:
sbr_offset_ptr = sbr_offset[0];
......@@ -293,6 +286,13 @@ static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr,
return -1;
}
if (sbr->sample_rate < 32000) {
temp = 3000;
} else if (sbr->sample_rate < 64000) {
temp = 4000;
} else
temp = 5000;
start_min = ((temp << 7) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
stop_min = ((temp << 8) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
......
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