From: Søren Sandmann Pedersen Date: Mon, 17 Jan 2011 19:12:20 +0000 (-0500) Subject: Fix dangling-pointer bug in bits_image_fetch_bilinear_no_repeat_8888(). X-Git-Tag: pixman-0.21.4~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d7195dd6c68eab73d063f37de3a9331446111d4;p=platform%2Fupstream%2Fpixman.git 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. --- 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 {