aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-04-21 22:19:31 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-06-18 01:16:04 +0200
commitbe9c4cc0e60a2e7cecd25d9c78d4f11aba274620 (patch)
treea17beec376808f4ad2f6677f44b86b3595768633
parent1d5694ba1101e6d26f15909eee0d10c6a4fe55c3 (diff)
downloadffmpeg-be9c4cc0e60a2e7cecd25d9c78d4f11aba274620.tar.gz
avcodec/ffv1enc: Check that the crc + version combination is supported
The crc flag is only stored since version 3 thus before this crcs do not work. We increase the version as needed same as we do with pix_fmts Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit d9706f79c17a33bf97e51a7d6ab211ce83a463ee) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/ffv1enc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index c9a885ebfa..2759db31d3 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -539,6 +539,10 @@ static av_cold int encode_init(AVCodecContext *avctx)
s->ec = (s->version >= 3);
}
+ // CRC requires version 3+
+ if (s->ec)
+ s->version = FFMAX(s->version, 3);
+
if ((s->version == 2 || s->version>3) && avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
av_log(avctx, AV_LOG_ERROR, "Version 2 needed for requested features but version 2 is experimental and not enabled\n");
return AVERROR_INVALIDDATA;