summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_expand.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-18 17:59:32 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-18 17:59:32 +0000
commit1c24ffe51b1bc8d7c544ad2081d7cfb94f8f45fb (patch)
treeaedafa054e509745fc63c7a16cae6c40dcb3e064 /libmpcodecs/vf_expand.c
parent0a62f708c7909822dc5c11aed8aea46a445292e4 (diff)
downloadmpv-1c24ffe51b1bc8d7c544ad2081d7cfb94f8f45fb.tar.bz2
mpv-1c24ffe51b1bc8d7c544ad2081d7cfb94f8f45fb.tar.xz
don't allow invalid parameters
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5688 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vf_expand.c')
-rw-r--r--libmpcodecs/vf_expand.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libmpcodecs/vf_expand.c b/libmpcodecs/vf_expand.c
index 622965acfe..f861eb8aed 100644
--- a/libmpcodecs/vf_expand.c
+++ b/libmpcodecs/vf_expand.c
@@ -147,11 +147,8 @@ static int config(struct vf_instance_s* vf,
// 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;