[MPlayer-cvslog] r24699 - trunk/libmpcodecs/vf_ow.c

michael subversion at mplayerhq.hu
Thu Oct 4 14:32:54 CEST 2007


Author: michael
Date: Thu Oct  4 14:32:54 2007
New Revision: 24699

Log:
fix infinite loop


Modified:
   trunk/libmpcodecs/vf_ow.c

Modified: trunk/libmpcodecs/vf_ow.c
==============================================================================
--- trunk/libmpcodecs/vf_ow.c	(original)
+++ trunk/libmpcodecs/vf_ow.c	Thu Oct  4 14:32:54 2007
@@ -167,15 +167,19 @@ static void filter(struct vf_priv_s *p, 
     int x,y, i, j;
     double sum=0;
     double s= p->strength[!is_luma];
+    int depth= p->depth;
+
+    while(1<<depth > width || 1<<depth > height)
+        depth--;
 
     for(y=0; y<height; y++)
         for(x=0; x<width; x++)
             p->plane[0][0][x + y*p->stride]= src[x + y*src_stride];
 
-    for(i=0; i<p->depth; i++){
+    for(i=0; i<depth; i++){
         decompose2D2(p->plane[i+1], p->plane[i][0], p->plane[0]+1,p->stride, 1<<i, width, height);
     }
-    for(i=0; i<p->depth; i++){
+    for(i=0; i<depth; i++){
         for(j=1; j<4; j++){
             for(y=0; y<height; y++){
                 for(x=0; x<width; x++){
@@ -188,7 +192,7 @@ static void filter(struct vf_priv_s *p, 
             }
         }
     }
-    for(i=p->depth-1; i>=0; i--){
+    for(i=depth-1; i>=0; i--){
         compose2D2(p->plane[i][0], p->plane[i+1], p->plane[0]+1, p->stride, 1<<i, width, height);
     }
 



More information about the MPlayer-cvslog mailing list