mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
aacdec: prevent channels from exceeding MAX_CHANNELS.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
01fd1aa0ad
commit
ba02069a8e
@ -149,6 +149,10 @@ static av_cold int che_configure(AACContext *ac,
|
||||
ff_aac_sbr_ctx_init(ac, &ac->che[type][id]->sbr);
|
||||
}
|
||||
if (type != TYPE_CCE) {
|
||||
if (*channels >= MAX_CHANNELS - (type == TYPE_CPE || (type == TYPE_SCE && ac->m4ac.ps == 1))) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, "Too many channels\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
ac->output_data[(*channels)++] = ac->che[type][id]->ch[0].ret;
|
||||
if (type == TYPE_CPE ||
|
||||
(type == TYPE_SCE && ac->m4ac.ps == 1)) {
|
||||
|
Loading…
Reference in New Issue
Block a user