[FFmpeg-cvslog] avcodec/ffv1enc: Check that the crc + version combination is supported

Michael Niedermayer git at videolan.org
Sat Jun 16 01:30:28 EEST 2018


ffmpeg | branch: release/4.0 | Michael Niedermayer <michael at niedermayer.cc> | Sat Apr 21 22:19:31 2018 +0200| [6d2c5bb5d2fa9339e06a39eb1a0e6e21baaa1a57] | committer: Michael Niedermayer

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 at niedermayer.cc>
(cherry picked from commit d9706f79c17a33bf97e51a7d6ab211ce83a463ee)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6d2c5bb5d2fa9339e06a39eb1a0e6e21baaa1a57
---

 libavcodec/ffv1enc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index dd4d7429f5..23e8d3dfa4 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;



More information about the ffmpeg-cvslog mailing list