Mercurial > libavcodec.hg
comparison snow.c @ 9373:78c2ddc32bed libavcodec
Make sure spatial_decomposition_count is not too large for picture size.
this led to an infinite loop in mirror().
author | michael |
---|---|
date | Thu, 09 Apr 2009 20:23:13 +0000 |
parents | 9bb96825fc10 |
children | c3a8ca9d0477 |
comparison
equal
deleted
inserted
replaced
9372:9bb96825fc10 | 9373:78c2ddc32bed |
---|---|
3623 s->spatial_decomposition_type+= get_symbol(&s->c, s->header_state, 1); | 3623 s->spatial_decomposition_type+= get_symbol(&s->c, s->header_state, 1); |
3624 if(s->spatial_decomposition_type > 1U){ | 3624 if(s->spatial_decomposition_type > 1U){ |
3625 av_log(s->avctx, AV_LOG_ERROR, "spatial_decomposition_type %d not supported", s->spatial_decomposition_type); | 3625 av_log(s->avctx, AV_LOG_ERROR, "spatial_decomposition_type %d not supported", s->spatial_decomposition_type); |
3626 return -1; | 3626 return -1; |
3627 } | 3627 } |
3628 if(FFMIN(s->avctx-> width>>s->chroma_h_shift, | |
3629 s->avctx->height>>s->chroma_v_shift) >> (s->spatial_decomposition_count-1) <= 0){ | |
3630 av_log(s->avctx, AV_LOG_ERROR, "spatial_decomposition_count %d too large for size", s->spatial_decomposition_count); | |
3631 return -1; | |
3632 } | |
3628 | 3633 |
3629 s->qlog += get_symbol(&s->c, s->header_state, 1); | 3634 s->qlog += get_symbol(&s->c, s->header_state, 1); |
3630 s->mv_scale += get_symbol(&s->c, s->header_state, 1); | 3635 s->mv_scale += get_symbol(&s->c, s->header_state, 1); |
3631 s->qbias += get_symbol(&s->c, s->header_state, 1); | 3636 s->qbias += get_symbol(&s->c, s->header_state, 1); |
3632 s->block_max_depth+= get_symbol(&s->c, s->header_state, 1); | 3637 s->block_max_depth+= get_symbol(&s->c, s->header_state, 1); |