[FFmpeg-cvslog] ffv1enc: Check context_model

Michael Niedermayer git at videolan.org
Tue Mar 20 00:39:45 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Mar 20 00:29:34 2012 +0100| [e01f478dd25ec64cce5064de361881e60c9db651] | committer: Michael Niedermayer

ffv1enc: Check context_model

Fixes crash

Found-by: durandal_1707
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/ffv1.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index fb9b030..95beddf 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -936,6 +936,10 @@ static av_cold int encode_init(AVCodecContext *avctx)
     if (s->transparency) {
         av_log(avctx, AV_LOG_WARNING, "Storing alpha plane, this will require a recent FFV1 decoder to playback!\n");
     }
+    if (avctx->context_model > 1U) {
+        av_log(avctx, AV_LOG_ERROR, "Invalid context model %d, valid values are 0 and 1\n", avctx->context_model);
+        return AVERROR(EINVAL);
+    }
 
     for(i=0; i<256; i++){
         s->quant_table_count=2;



More information about the ffmpeg-cvslog mailing list