changeset 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
files snow.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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);