Search
SailfishOS Open Build Service
>
Projects
>
home:siteshwar
:
branches:nemo:devel:mw
>
xulrunner-qt5
> _service:tar_git:0008-Limit-surface-area-rather-than-width-and-height.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File _service:tar_git:0008-Limit-surface-area-rather-than-width-and-height.patch of Package xulrunner-qt5
From f7aa36252cc5e7995981abcc7ed93729eccf6bf2 Mon Sep 17 00:00:00 2001 From: Dmitry Rozhkov <dmitry.rozhkov@jolla.com> Date: Mon, 11 May 2015 13:17:36 +0300 Subject: [PATCH 08/15] Limit surface area rather than width and height See bug JB26935 Signed-off-by: Raine Makelainen <raine.makelainen@jolla.com> --- gfx/cairo/cairo/src/cairo-image-surface.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gfx/cairo/cairo/src/cairo-image-surface.c b/gfx/cairo/cairo/src/cairo-image-surface.c index a77f786..17c40a0 100644 --- a/gfx/cairo/cairo/src/cairo-image-surface.c +++ b/gfx/cairo/cairo/src/cairo-image-surface.c @@ -91,8 +91,9 @@ _pixman_image_for_solid (const cairo_solid_pattern_t *pattern); static cairo_bool_t _cairo_image_surface_is_size_valid (int width, int height) { - return 0 <= width && width <= MAX_IMAGE_SIZE && - 0 <= height && height <= MAX_IMAGE_SIZE; + const int area = width*height; + return 0 <= width && 0 <= height && 0 <= area && + area <= (MAX_IMAGE_SIZE*MAX_IMAGE_SIZE); } cairo_format_t -- 2.1.4