sna: Remove bogus check for color == 0

This was written when the RGBA color value was being passed around and
not the pointer to the xRenderColor. As such, the NULL deref check
doesn't gain much and the check for rgba==0 irrelevant in this scenario.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-06-04 13:49:35 +01:00
parent 9b3937228c
commit 6dc5ddfe80
1 changed files with 3 additions and 4 deletions

View File

@ -154,10 +154,8 @@ no_render_fill_boxes(struct sna *sna,
__FUNCTION__, op,
color->red, color->green, color->blue, color->alpha));
if (color == 0)
op = PictOpClear;
if (op == PictOpClear) {
pixel = 0;
alu = GXclear;
op = PictOpSrc;
}
@ -170,7 +168,8 @@ no_render_fill_boxes(struct sna *sna,
if (op != PictOpSrc)
return FALSE;
if (!sna_get_pixel_from_rgba(&pixel,
if (alu == GXcopy &&
!sna_get_pixel_from_rgba(&pixel,
color->red,
color->green,
color->blue,