aaccoder: prevent crash of anmr coder

If minq is negative, the range of sf_idx can be larger than
SCALE_MAX_DIFF allows, causing assertion failures later in
encode_scale_factors.

Reviewed-by: Claudio Freire <klaussfreire@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 7a4652dd5d)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
Andreas Cadhalpun 2015-12-04 18:13:07 +01:00
parent e56d322032
commit c78d268e9f
1 changed files with 1 additions and 1 deletions

View File

@ -728,7 +728,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
}
while (idx) {
sce->sf_idx[bandaddr[idx]] = minq + q0;
minq = paths[idx][minq].prev;
minq = FFMAX(paths[idx][minq].prev, 0);
idx--;
}
//set the same quantizers inside window groups