aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-20 00:29:34 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-03-20 00:29:34 +0100
commite01f478dd25ec64cce5064de361881e60c9db651 (patch)
tree75470d8813fac597d6815edb8a77fed7605f3793
parent479fb7b8afcf0711b93b48c7d634e9f464d8b336 (diff)
downloadffmpeg-e01f478dd25ec64cce5064de361881e60c9db651.tar.gz
ffv1enc: Check context_model
Fixes crash Found-by: durandal_1707 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/ffv1.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index fb9b03041b..95beddf283 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;