]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Make sure spatial_decomposition_count is >0.
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Thu, 9 Apr 2009 19:45:10 +0000 (19:45 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Thu, 9 Apr 2009 19:45:10 +0000 (19:45 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18394 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/snow.c

index d246b9abf28d5c8e02ce82cf657293d50a832536..501b60dde49898e073d9010a2f0b2432b57c0b5b 100644 (file)
@@ -3582,7 +3582,7 @@ static int decode_header(SnowContext *s){
         s->always_reset= get_rac(&s->c, s->header_state);
         s->temporal_decomposition_type= get_symbol(&s->c, s->header_state, 0);
         s->temporal_decomposition_count= get_symbol(&s->c, s->header_state, 0);
-        GET_S(s->spatial_decomposition_count, tmp <= (unsigned)MAX_DECOMPOSITIONS)
+        GET_S(s->spatial_decomposition_count, 0 < tmp && tmp <= MAX_DECOMPOSITIONS)
         s->colorspace_type= get_symbol(&s->c, s->header_state, 0);
         s->chroma_h_shift= get_symbol(&s->c, s->header_state, 0);
         s->chroma_v_shift= get_symbol(&s->c, s->header_state, 0);
@@ -3615,7 +3615,7 @@ static int decode_header(SnowContext *s){
             memcpy(s->plane[2].hcoeff, s->plane[1].hcoeff, sizeof(s->plane[1].hcoeff));
         }
         if(get_rac(&s->c, s->header_state)){
-            GET_S(s->spatial_decomposition_count, tmp <= (unsigned)MAX_DECOMPOSITIONS)
+            GET_S(s->spatial_decomposition_count, 0 < tmp && tmp <= MAX_DECOMPOSITIONS)
             decode_qlogs(s);
         }
     }