# HG changeset patch # User michael # Date 1239308593 0 # Node ID 78c2ddc32bed299a6a4e1ec05dc4a31d24fb3aef # Parent 9bb96825fc105b96ad72b2696f6e6dc856dc4423 Make sure spatial_decomposition_count is not too large for picture size. this led to an infinite loop in mirror(). diff -r 9bb96825fc10 -r 78c2ddc32bed snow.c --- a/snow.c Thu Apr 09 20:13:35 2009 +0000 +++ b/snow.c Thu Apr 09 20:23:13 2009 +0000 @@ -3625,6 +3625,11 @@ av_log(s->avctx, AV_LOG_ERROR, "spatial_decomposition_type %d not supported", s->spatial_decomposition_type); return -1; } + if(FFMIN(s->avctx-> width>>s->chroma_h_shift, + s->avctx->height>>s->chroma_v_shift) >> (s->spatial_decomposition_count-1) <= 0){ + av_log(s->avctx, AV_LOG_ERROR, "spatial_decomposition_count %d too large for size", s->spatial_decomposition_count); + return -1; + } s->qlog += get_symbol(&s->c, s->header_state, 1); s->mv_scale += get_symbol(&s->c, s->header_state, 1);