summaryrefslogtreecommitdiff
path: root/libavcodec/dnxhdenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-17 20:58:43 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-17 20:58:43 +0100
commit19df5dcb4734d699da7177d5cfc8dc1bdcbf91c1 (patch)
treef0ce7ff62fd57a9369dc7e2544659940a432c0e9 /libavcodec/dnxhdenc.c
parentf1caaa1c61310beba705957e6366f0392a0b005b (diff)
avcodec/dnxhdenc: check that qmax is within the supported range
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dnxhdenc.c')
-rw-r--r--libavcodec/dnxhdenc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index b16c7ed97d..ab2b7c6478 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -341,6 +341,11 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
return -1;
}
+ if (avctx->qmax <= 1) {
+ av_log(avctx, AV_LOG_ERROR, "qmax must be at least 2\n");
+ return AVERROR(EINVAL);
+ }
+
ctx->thread[0] = ctx;
for (i = 1; i < avctx->thread_count; i++) {
ctx->thread[i] = av_malloc(sizeof(DNXHDEncContext));