forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mozilla#3 from monich/max_image_size
Limit the area of the surface rather than width and height
- Loading branch information
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
rpm/cairo-limit-surface-area-rather-than-width-and-height.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters