mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-14 10:08:05 +02:00
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.
This commit is contained in:
parent
03597cf802
commit
6c9d6898fd
1 changed files with 6 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue