summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSinclair Yeh <[email protected]>2014-02-12 16:21:11 -0800
committerKristian Høgsberg <[email protected]>2014-02-18 14:12:11 -0800
commit6c9d6898fdfd7e23306762af9bf2501a5bca1974 (patch)
tree14af1919cc863fea0063f6c5561d41926ddc9ef1 /src
parent03597cf802a7a89c4853794e6206ab8ab003898d (diff)
Prevent zero sized wl_egl_window
It is illegal to create or resize a window to zero (or negative) width and/or height. This patch prevents such a request from happening.
Diffstat (limited to 'src')
-rw-r--r--src/egl/wayland/wayland-egl/wayland-egl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/egl/wayland/wayland-egl/wayland-egl.c b/src/egl/wayland/wayland-egl/wayland-egl.c
index 8bd49cf6c4f..ae78595b92c 100644
--- a/src/egl/wayland/wayland-egl/wayland-egl.c
+++ b/src/egl/wayland/wayland-egl/wayland-egl.c
@@ -9,6 +9,9 @@ wl_egl_window_resize(struct wl_egl_window *egl_window,
int width, int height,
int dx, int dy)
{
+ if (width <= 0 || height <= 0)
+ return;
+
egl_window->width = width;
egl_window->height = height;
egl_window->dx = dx;
@@ -24,6 +27,9 @@ wl_egl_window_create(struct wl_surface *surface,
{
struct wl_egl_window *egl_window;
+ if (width <= 0 || height <= 0)
+ return NULL;
+
egl_window = malloc(sizeof *egl_window);
if (!egl_window)
return NULL;