summaryrefslogtreecommitdiff
path: root/pixman/pixman-bits-image.c
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2011-01-17 14:12:20 -0500
committerSøren Sandmann Pedersen <ssp@redhat.com>2011-01-19 07:22:42 -0500
commit1d7195dd6c68eab73d063f37de3a9331446111d4 (patch)
treeb40a7261fadb7bdfd3d9f09167a758683f997dd0 /pixman/pixman-bits-image.c
parent2ac4ae1ae253f7c2efedab036a677dac2f9c9eed (diff)
Fix dangling-pointer bug in bits_image_fetch_bilinear_no_repeat_8888().
The mask_bits variable is only declared in a limited scope, so the pointer to it becomes invalid instantly. Somehow this didn't actually trigger any bugs, but Brent Fulgham reported that Bounds Checker was complaining about it. Fix the bug by moving mask_bits to the function scope.
Diffstat (limited to 'pixman/pixman-bits-image.c')
-rw-r--r--pixman/pixman-bits-image.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c
index 98a2b6d..a865d71 100644
--- a/pixman/pixman-bits-image.c
+++ b/pixman/pixman-bits-image.c
@@ -295,6 +295,7 @@ bits_image_fetch_bilinear_no_repeat_8888 (pixman_image_t * ima,
uint32_t *bottom_row;
uint32_t *end;
uint32_t zero[2] = { 0, 0 };
+ uint32_t one = 1;
int y, y1, y2;
int disty;
int mask_inc;
@@ -360,10 +361,8 @@ bits_image_fetch_bilinear_no_repeat_8888 (pixman_image_t * ima,
*/
if (!mask)
{
- uint32_t mask_bits = 1;
-
mask_inc = 0;
- mask = &mask_bits;
+ mask = &one;
}
else
{