Commit 894b1ae7 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Avoid integer overflow

Use g_malloc_n in gdk_cairo_set_source_pixbuf when allocating
a large block of memory, to avoid integer overflow.

Pointed out by Bert Massop in
parent f0a8d115
......@@ -213,7 +213,7 @@ gdk_cairo_set_source_pixbuf (cairo_t *cr,
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,
width, height, cairo_stride);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment