# HG changeset patch # User arpi # Date 1019152772 0 # Node ID f19dff1456ed2927ce2c4cc346b7b1baf5eac31b # Parent 00ac1397ecb78a67c0b814eb53d094e510f8a1e7 don't allow invalid parameters diff -r 00ac1397ecb7 -r f19dff1456ed libmpcodecs/vf_expand.c --- a/libmpcodecs/vf_expand.c Thu Apr 18 17:41:54 2002 +0000 +++ b/libmpcodecs/vf_expand.c Thu Apr 18 17:59:32 2002 +0000 @@ -147,11 +147,8 @@ // calculate the missing parameters: if(vf->priv->exp_wpriv->exp_w=width; if(vf->priv->exp_hpriv->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;