Browse Source

avcodec/dnxhdenc: check that qmax is within the supported range

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.2-rc1
Michael Niedermayer 12 years ago
parent
commit
19df5dcb47
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/dnxhdenc.c

+ 5
- 0
libavcodec/dnxhdenc.c View File

@@ -341,6 +341,11 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
return -1; 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; ctx->thread[0] = ctx;
for (i = 1; i < avctx->thread_count; i++) { for (i = 1; i < avctx->thread_count; i++) {
ctx->thread[i] = av_malloc(sizeof(DNXHDEncContext)); ctx->thread[i] = av_malloc(sizeof(DNXHDEncContext));


Loading…
Cancel
Save