mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-28 12:32:17 +02:00
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 7a4652dd5da0502ff21c183b5ca7d76b1cfd6c51) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
parent
76af12f542
commit
507e0314c0
@ -499,7 +499,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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user