diff options
author | monsta <[email protected]> | 2016-02-10 14:52:54 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-02-10 15:01:54 +0300 |
commit | 4f525350f4cdcb3419e12ec7ffc85373d87987b7 (patch) | |
tree | a48c124847b7c38f9af8ace1f631e18a4712c953 /src | |
parent | d4ae3f8f09f99a01196e0776869b33e487797d1f (diff) | |
download | eom-4f525350f4cdcb3419e12ec7ffc85373d87987b7.tar.bz2 eom-4f525350f4cdcb3419e12ec7ffc85373d87987b7.tar.xz |
avoid integer overflow when allocating a large block of memory
it's the same issue as in gdk_cairo_set_source_pixbuf since the code
is apparently copied from there.
fix is taken from
https://git.gnome.org/browse/gtk+/commit?id=894b1ae76a32720f4bb3d39cf460402e3ce331d6
Diffstat (limited to 'src')
-rw-r--r-- | src/eom-print-preview.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/eom-print-preview.c b/src/eom-print-preview.c index f9f005f..7dc2a8a 100644 --- a/src/eom-print-preview.c +++ b/src/eom-print-preview.c @@ -732,7 +732,7 @@ create_surface_from_pixbuf (GdkPixbuf *pixbuf) format = CAIRO_FORMAT_ARGB32; cairo_stride = cairo_format_stride_for_width (format, width); - cairo_pixels = g_malloc (height * cairo_stride); + cairo_pixels = g_malloc_n (height, cairo_stride); surface = cairo_image_surface_create_for_data ((unsigned char *)cairo_pixels, format, width, height, cairo_stride); |