mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/mpegvideo_enc: check qmin/qmax
Fixes Ticket2990 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
c88ac1e023
commit
bb4b041df3
|
@ -629,6 +629,11 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
|
||||||
s->inter_quant_bias = -(1 << (QUANT_BIAS_SHIFT - 2));
|
s->inter_quant_bias = -(1 << (QUANT_BIAS_SHIFT - 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (avctx->qmin > avctx->qmax || avctx->qmin <= 0) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "qmin and or qmax are invalid, they must be 0 < min <= max\n");
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
if (avctx->intra_quant_bias != FF_DEFAULT_QUANT_BIAS)
|
if (avctx->intra_quant_bias != FF_DEFAULT_QUANT_BIAS)
|
||||||
s->intra_quant_bias = avctx->intra_quant_bias;
|
s->intra_quant_bias = avctx->intra_quant_bias;
|
||||||
if (avctx->inter_quant_bias != FF_DEFAULT_QUANT_BIAS)
|
if (avctx->inter_quant_bias != FF_DEFAULT_QUANT_BIAS)
|
||||||
|
|
Loading…
Reference in New Issue