Commit 26b74a72 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

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: 's avatarClaudio Freire <klaussfreire@gmail.com>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 7a4652dd)
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent cc770123
...@@ -691,7 +691,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s, ...@@ -691,7 +691,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
} }
while (idx) { while (idx) {
sce->sf_idx[bandaddr[idx]] = minq + q0; sce->sf_idx[bandaddr[idx]] = minq + q0;
minq = paths[idx][minq].prev; minq = FFMAX(paths[idx][minq].prev, 0);
idx--; idx--;
} }
//set the same quantizers inside window groups //set the same quantizers inside window groups
......
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