summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-02-05 17:47:43 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-02-05 17:47:43 +0000
commit3baddb9645a6b0af4a22bc0d60554cf91fa903df (patch)
tree74fc9ed336db78387d34aa404b1b11510a649532 /libvo
parent5f2616850097de5b62d392a822d7f7261904141a (diff)
downloadmpv-3baddb9645a6b0af4a22bc0d60554cf91fa903df.tar.bz2
mpv-3baddb9645a6b0af4a22bc0d60554cf91fa903df.tar.xz
Sanity check for vo window dimensions, helps avoid division by zero
with -wid. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22148 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_xv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c
index 47e3cf1556..2aff1742b1 100644
--- a/libvo/vo_xv.c
+++ b/libvo/vo_xv.c
@@ -313,6 +313,8 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
XGetGeometry(mDisplay, vo_window, &mRoot,
&drwX, &drwY, &vo_dwidth, &vo_dheight,
&drwBorderWidth, &drwDepth);
+ if (vo_dwidth <= 0) vo_dwidth = d_width;
+ if (vo_dheight <= 0) vo_dheight = d_height;
drwX = drwY = 0; // coordinates need to be local to the window
aspect_save_prescale(vo_dwidth, vo_dheight);
} else