summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2018-04-21 22:19:31 +0200
committerMichael Niedermayer <[email protected]>2018-07-10 01:52:55 +0200
commit8eee712737c2aa2f643998e752f480ad42bb0612 (patch)
tree75f56fcf56e39cc758be4856167d487e795396f4
parent18772823239094cb23df43ceb01152a9bcf80710 (diff)
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 <[email protected]> (cherry picked from commit d9706f79c17a33bf97e51a7d6ab211ce83a463ee) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavcodec/ffv1enc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 3b425d68ed..b27c3a1328 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -690,6 +690,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;