summaryrefslogtreecommitdiff
path: root/libavcodec/snow.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-12-03 14:20:03 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-12-03 14:20:03 +0000
commit4393e6392c123142eb248d62d4109fb422ce99e3 (patch)
tree21ca9869c335c75a4b482c1b4db925963bb8ff21 /libavcodec/snow.c
parent91aa4e3300482b46a01ad60d7fa85a61cfe24e0a (diff)
check block_max_depth (fixes crash)
Originally committed as revision 4718 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/snow.c')
-rw-r--r--libavcodec/snow.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index fb518315cc..4207951ffa 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -3185,6 +3185,11 @@ static int decode_header(SnowContext *s){
s->mv_scale= get_symbol(&s->c, s->header_state, 0);
s->qbias= get_symbol(&s->c, s->header_state, 1);
s->block_max_depth= get_symbol(&s->c, s->header_state, 0);
+ if(s->block_max_depth > 1){
+ av_log(s->avctx, AV_LOG_ERROR, "block_max_depth= %d is too large", s->block_max_depth);
+ s->block_max_depth= 0;
+ return -1;
+ }
return 0;
}