Skip to content

Commit

Permalink
Merge pull request mozilla#3 from monich/max_image_size
Browse files Browse the repository at this point in the history
Limit the area of the surface rather than width and height
  • Loading branch information
rojkov committed Mar 9, 2015
2 parents ad8470b + 7b3c662 commit 7efd537
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions rpm/cairo-limit-surface-area-rather-than-width-and-height.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- 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 changes: 2 additions & 0 deletions rpm/xulrunner-qt5.spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Patch11: disabledestructible.patch
Patch12: 0001-Don-t-zoom-video-when-in-full-screen.patch
Patch13: Disallow-image-locking-no-matter-what.patch
Patch14: Notify-UI-about-change-in-composition-bounds-jb17999.patch
Patch15: cairo-limit-surface-area-rather-than-width-and-height.patch
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(pango)
Expand Down Expand Up @@ -86,6 +87,7 @@ Tests and misc files for xulrunner
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1

%build
export DONT_POPULATE_VIRTUALENV=1
Expand Down

0 comments on commit 7efd537

Please sign in to comment.