diff options
author | al <al@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-11-10 02:39:31 +0000 |
---|---|---|
committer | al <al@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-11-10 02:39:31 +0000 |
commit | fb8da06ed75c53a69a3a3f276c5e9631271d0249 (patch) | |
tree | 76f4b4e99612bff2cf6bc7ba4f09a13b90490c1d /libvo/vo_xv.c | |
parent | 3ccd4245293941c68dd3d0e02a1106944031ca54 (diff) | |
download | mpv-fb8da06ed75c53a69a3a3f276c5e9631271d0249.tar.bz2 mpv-fb8da06ed75c53a69a3a3f276c5e9631271d0249.tar.xz |
Test if source image dimensions are too big.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16959 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_xv.c')
-rw-r--r-- | libvo/vo_xv.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c index fd074c19e1..08d5e958f1 100644 --- a/libvo/vo_xv.c +++ b/libvo/vo_xv.c @@ -22,6 +22,7 @@ Buffer allocation: #include "config.h" #include "mp_msg.h" +#include "help_mp.h" #include "video_out.h" #include "video_out_internal.h" @@ -89,6 +90,7 @@ static int int_pause; static Window mRoot; static uint32_t drwX, drwY, drwBorderWidth, drwDepth; static uint32_t dwidth, dheight; +static uint32_t max_width = 0, max_height = 0; // zero means: not set static void (*draw_alpha_fnc) (int x0, int y0, int w, int h, unsigned char *src, unsigned char *srca, @@ -175,6 +177,14 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, image_width = width; image_format = format; + if ((max_width != 0 && max_height != 0) && + (image_width > max_width || image_height > max_height)) + { + mp_msg( MSGT_VO, MSGL_ERR, "[xv] " MSGTR_VO_XV_ImagedimTooHigh, + image_width, image_height, max_width, max_height); + return -1; + } + vo_mouse_autohide = 1; int_pause = 0; @@ -918,6 +928,7 @@ static int preinit(const char *arg) return -1; // bail out, colorkey setup failed } vo_xv_enable_vsync(); + vo_xv_get_max_img_dim( &max_width, &max_height ); fo = XvListImageFormats(mDisplay, xv_port, (int *) &formats); |