The (deprecated) field AVCodecContext.mpeg_quant has no range restriction; MpegEncContext.mpeg_quant is restricted to 0..1. If the former is set, the latter is overwritten with it without checking the range. This can trigger an av_assert2() with the MPEG-4 encoder when writing said field. Fix this by just setting MpegEncContext.mpeg_quant to 1 if AVCodecContext.mpeg_quant is set.
Unified · Split
| @@ -627,7 +627,7 @@ FF_ENABLE_DEPRECATION_WARNINGS · 626 unmodified lines | |||
| 627 | #if FF_API_PRIVATE_OPT | 627 | #if FF_API_PRIVATE_OPT |
| 628 | FF_DISABLE_DEPRECATION_WARNINGS | 628 | FF_DISABLE_DEPRECATION_WARNINGS |
| 629 | if (avctx->mpeg_quant) | 629 | if (avctx->mpeg_quant) |
| 630 | s->mpeg_quant = avctx->mpeg_quant; | 630 | s->mpeg_quant = 1; |
| 631 | FF_ENABLE_DEPRECATION_WARNINGS | 631 | FF_ENABLE_DEPRECATION_WARNINGS |
| 632 | #endif | 632 | #endif |
| 633 | 633 | ||