[Mplayer-cvslog] CVS: main/libmpcodecs vf_expand.c,1.6,1.7

Arpi of Ize arpi at mplayerhq.hu
Thu Apr 18 19:59:34 CEST 2002


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv3428

Modified Files:
	vf_expand.c 
Log Message:
don't allow invalid parameters

Index: vf_expand.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_expand.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- vf_expand.c	17 Apr 2002 22:19:14 -0000	1.6
+++ vf_expand.c	18 Apr 2002 17:59:32 -0000	1.7
@@ -147,11 +147,8 @@
     // calculate the missing parameters:
     if(vf->priv->exp_w<width) vf->priv->exp_w=width;
     if(vf->priv->exp_h<height) vf->priv->exp_h=height;
-    if(vf->priv->exp_x<0) vf->priv->exp_x=(vf->priv->exp_w-width)/2;
-    if(vf->priv->exp_y<0) vf->priv->exp_y=(vf->priv->exp_h-height)/2;
-    // check:
-//    if(vf->priv->exp_w+vf->priv->exp_x>width) return 0; // bad width
-//    if(vf->priv->exp_h+vf->priv->exp_y>height) return 0; // bad height
+    if(vf->priv->exp_x<0 || vf->priv->exp_x+width>vf->priv->exp_w) vf->priv->exp_x=(vf->priv->exp_w-width)/2;
+    if(vf->priv->exp_y<0 || vf->priv->exp_y+height>vf->priv->exp_h) vf->priv->exp_y=(vf->priv->exp_h-height)/2;
     vf->priv->fb_ptr=NULL;
     ret=vf_next_config(vf,vf->priv->exp_w,vf->priv->exp_h,d_width,d_height,flags,outfmt);
     return ret;




More information about the MPlayer-cvslog mailing list