summaryrefslogtreecommitdiff
path: root/src/cairo-image-surface-private.h
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2016-10-20 21:12:30 +1030
committerBryce Harrington <bryce@osg.samsung.com>2017-11-07 17:01:49 -0800
commit38fbe621cf80d560cfc27b54b5417b62cda64c8a (patch)
treec6fc5177933c3ebb368e7531eb187ba994ae97a4 /src/cairo-image-surface-private.h
parent35fccff6ec393ccca3d3ced79093ca491ce32df4 (diff)
downloadcairo-38fbe621cf80d560cfc27b54b5417b62cda64c8a.tar.gz
image: prevent invalid ptr access for > 4GB images
Image data is often accessed using: image->data + y * image->stride On 64-bit achitectures if the image data is > 4GB, this computation will overflow since both y and stride are 32-bit types. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=98165 Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Diffstat (limited to 'src/cairo-image-surface-private.h')
-rw-r--r--src/cairo-image-surface-private.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cairo-image-surface-private.h b/src/cairo-image-surface-private.h
index 8ca694c5e..7e78d6153 100644
--- a/src/cairo-image-surface-private.h
+++ b/src/cairo-image-surface-private.h
@@ -71,7 +71,7 @@ struct _cairo_image_surface {
int width;
int height;
- int stride;
+ ptrdiff_t stride;
int depth;
unsigned owns_data : 1;