summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/snowdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c
index 0ac0b55012..6eff729a19 100644
--- a/libavcodec/snowdec.c
+++ b/libavcodec/snowdec.c
@@ -394,9 +394,10 @@ static int decode_header(SnowContext *s){
s->mv_scale += get_symbol(&s->c, s->header_state, 1);
s->qbias += get_symbol(&s->c, s->header_state, 1);
s->block_max_depth+= get_symbol(&s->c, s->header_state, 1);
- if(s->block_max_depth > 1 || s->block_max_depth < 0){
+ if(s->block_max_depth > 1 || s->block_max_depth < 0 || s->mv_scale > 256U){
av_log(s->avctx, AV_LOG_ERROR, "block_max_depth= %d is too large\n", s->block_max_depth);
s->block_max_depth= 0;
+ s->mv_scale = 0;
return AVERROR_INVALIDDATA;
}
if (FFABS(s->qbias) > 127) {