[Pixman] [PATCH 3/3] The code in 'bitmap_addrect' already assumes non-null 'reg->data'

Siarhei Siamashka siarhei.siamashka at gmail.com
Mon Jan 10 14:15:43 PST 2011


From: Siarhei Siamashka <siarhei.siamashka at nokia.com>

So the check of 'reg->data' pointer can be safely removed.
---
 pixman/pixman-region.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c
index 4e7c8db..13feff0 100644
--- a/pixman/pixman-region.c
+++ b/pixman/pixman-region.c
@@ -2545,8 +2545,7 @@ bitmap_addrect (region_type_t *reg,
 	   ((r-1)->y1 == ry1) && ((r-1)->y2 == ry2) &&
 	   ((r-1)->x1 <= rx1) && ((r-1)->x2 >= rx2))))
     {
-	if (!reg->data ||
-	    reg->data->numRects == reg->data->size)
+	if (reg->data->numRects == reg->data->size)
 	{
 	    if (!pixman_rect_alloc (reg, 1))
 		return NULL;
@@ -2590,6 +2589,8 @@ PREFIX (_init_from_image) (region_type_t *region,
 
     PREFIX(_init) (region);
 
+    assert (region->data);
+
     return_if_fail (image->type == BITS);
     return_if_fail (image->bits.format == PIXMAN_a1);
 
-- 
1.7.2.2



More information about the Pixman mailing list