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.
Unified · Split
| @@ -370,7 +370,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s, · 369 unmodified lines | ||
| 370 | 370 | } |
| 371 | 371 | while (idx) { |
| 372 | 372 | sce->sf_idx[bandaddr[idx]] = minq + q0; |
| 373 | − minq = paths[idx][minq].prev; | |
| 373 | + minq = FFMAX(paths[idx][minq].prev, 0); | |
| 374 | 374 | idx--; |
| 375 | 375 | } |
| 376 | 376 | //set the same quantizers inside window groups |