Browse Source

avcodec/ffv1enc: Fix error message when the requested version does not support the requested features

Found-by: "Peter B." <pb@das-werkstatt.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.0
Michael Niedermayer 9 years ago
parent
commit
72db5e96fc
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      libavcodec/ffv1enc.c

+ 7
- 2
libavcodec/ffv1enc.c View File

@@ -683,8 +683,13 @@ static av_cold int encode_init(AVCodecContext *avctx)
if (avctx->level <= 0 && s->version == 2) { if (avctx->level <= 0 && s->version == 2) {
s->version = 3; s->version = 3;
} }
if (avctx->level >= 0 && avctx->level <= 4)
s->version = FFMAX(s->version, avctx->level);
if (avctx->level >= 0 && avctx->level <= 4) {
if (avctx->level < s->version) {
av_log(avctx, AV_LOG_ERROR, "Version %d needed for requested features but %d requested\n", s->version, avctx->level);
return AVERROR(EINVAL);
}
s->version = avctx->level;
}


if (s->ec < 0) { if (s->ec < 0) {
s->ec = (s->version >= 3); s->ec = (s->version >= 3);


Loading…
Cancel
Save