mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-09 09:38:11 +02:00
cairo-xlib: Check for maximum surface size
This commit is contained in:
commit
01f38097a5
3 changed files with 5 additions and 2 deletions
|
|
@ -65,6 +65,8 @@ typedef struct _cairo_xlib_surface cairo_xlib_surface_t;
|
|||
#define RAMP_SIZE 16
|
||||
/* maximum number of cached GC's */
|
||||
#define GC_CACHE_SIZE 4
|
||||
/* maximum width/height of an X11 drawable */
|
||||
#define XLIB_COORD_MAX 32767
|
||||
|
||||
struct _cairo_xlib_display {
|
||||
cairo_device_t base;
|
||||
|
|
|
|||
|
|
@ -809,6 +809,9 @@ _cairo_xlib_shm_surface_create (cairo_xlib_surface_t *other,
|
|||
pixman_image_t *image;
|
||||
int stride, size;
|
||||
|
||||
if (width > XLIB_COORD_MAX || height > XLIB_COORD_MAX)
|
||||
return NULL;
|
||||
|
||||
stride = CAIRO_STRIDE_FOR_WIDTH_BPP (width, PIXMAN_FORMAT_BPP(format));
|
||||
size = stride * height;
|
||||
if (size < MIN_SIZE)
|
||||
|
|
|
|||
|
|
@ -72,8 +72,6 @@
|
|||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
|
||||
#define XLIB_COORD_MAX 32767
|
||||
|
||||
#define DEBUG 0
|
||||
|
||||
#if DEBUG
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue