summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2014-04-23 20:25:40 -0400
committerSøren Sandmann <ssp@redhat.com>2014-05-15 13:29:58 -0400
commit9cd283b2eb8279824406bfd47b020d21fc00cf82 (patch)
tree0b23ee8371b5b98f013820f724d17302a2605fd6
parentf5f5dbbbc668a3a90c6cfc79bbd2422805db31e7 (diff)
pixman-gradient-walker: Make left_x and right_x 64 bit variablesradial-stress
The variables left_x, and right_x in gradient_walker_reset() are computed from pos, which is a 64 bit quantity, so to avoid overflows, these variables must be 64 bit as well. Similarly, the left_x and right_x that are stored in pixman_gradient_walker_t need to be 64 bit as well; otherwise, pixman_gradient_walker_pixel() will call reset too often. This fixes the radial-invalid test, which was generating 'invalid' floating point exceptions when the overflows caused color values to be outside of [0, 255].
-rw-r--r--pixman/pixman-gradient-walker.c2
-rw-r--r--pixman/pixman-private.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/pixman/pixman-gradient-walker.c b/pixman/pixman-gradient-walker.c
index 5944a559..822f8e62 100644
--- a/pixman/pixman-gradient-walker.c
+++ b/pixman/pixman-gradient-walker.c
@@ -54,7 +54,7 @@ static void
gradient_walker_reset (pixman_gradient_walker_t *walker,
pixman_fixed_48_16_t pos)
{
- int32_t x, left_x, right_x;
+ int64_t x, left_x, right_x;
pixman_color_t *left_c, *right_c;
int n, count = walker->num_stops;
pixman_gradient_stop_t *stops = walker->stops;
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index 6ca13b21..fdc966ae 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -345,8 +345,8 @@ typedef struct
float r_s, r_b;
float g_s, g_b;
float b_s, b_b;
- pixman_fixed_t left_x;
- pixman_fixed_t right_x;
+ pixman_fixed_48_16_t left_x;
+ pixman_fixed_48_16_t right_x;
pixman_gradient_stop_t *stops;
int num_stops;