aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-25 00:44:17 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-25 00:44:17 +0200
commitbb4b041df351e49a0fa16007fb4505adea0836d8 (patch)
tree7178d39619714fb641155ea4d87bb04fbfd4117f
parentc88ac1e0233f34582312dc617261b9270b61df19 (diff)
downloadffmpeg-bb4b041df351e49a0fa16007fb4505adea0836d8.tar.gz
avcodec/mpegvideo_enc: check qmin/qmax
Fixes Ticket2990 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/mpegvideo_enc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 2e6acb28a3..a85cf563de 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -629,6 +629,11 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
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)
s->intra_quant_bias = avctx->intra_quant_bias;
if (avctx->inter_quant_bias != FF_DEFAULT_QUANT_BIAS)