From 4620a5e9bcd25eafe62936393d72487f3adeeb03 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Thu, 21 Apr 2011 13:52:12 +0200 Subject: [PATCH] Limit the width and height in _gdk_window_impl_new() to 16384 instead of 65535. The latter limit is too high to prevent crashes later on. --- gdk/x11/gdkwindow-x11.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 175adb6..4bc2257 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -665,6 +665,7 @@ _gdk_window_impl_new (GdkWindow *window, unsigned int class; const char *title; int i; + static const height_and_width_limit = 16384; private = (GdkWindowObject *) window; @@ -776,15 +777,16 @@ _gdk_window_impl_new (GdkWindow *window, g_object_ref (draw_impl->colormap); } - if (private->width > 65535 || - private->height > 65535) + if (private->width > height_and_width_limit || + private->height > height_and_width_limit) { - g_warning ("Native Windows wider or taller than 65535 pixels are not supported"); + g_warning ("Native Windows wider or taller than %d pixels are not supported", + height_and_width_limit); - if (private->width > 65535) - private->width = 65535; - if (private->height > 65535) - private->height = 65535; + if (private->width > height_and_width_limit) + private->width = height_and_width_limit; + if (private->height > height_and_width_limit) + private->height = height_and_width_limit; } xid = draw_impl->xid = XCreateWindow (xdisplay, xparent, -- 1.7.4.1