[xf86-video-intel,16/21] sna/fb: Initialize xoff/yoff
diff mbox series

Message ID 20190919163113.17402-17-ville.syrjala@linux.intel.com
State New
Headers show
Series
  • Compiler warn elimination
Related show

Commit Message

Ville Syrjälä Sept. 19, 2019, 4:31 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The compiler seems to think src/mask xoff/yoff can be used
uninitialized. Zero them to make sure.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/sna/fb/fbpict.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/src/sna/fb/fbpict.c b/src/sna/fb/fbpict.c
index abe223f31c88..8e65deb26fe9 100644
--- a/src/sna/fb/fbpict.c
+++ b/src/sna/fb/fbpict.c
@@ -313,8 +313,10 @@  image_from_pict_internal(PicturePtr pict, Bool has_clip, int *xoff, int *yoff,
 {
 	pixman_image_t *image = NULL;
 
-	if (!pict)
+	if (!pict) {
+		*xoff = *yoff = 0;
 		return NULL;
+	}
 
 	if (pict->pDrawable) {
 		image = create_bits_picture(pict, has_clip, xoff, yoff);
@@ -336,6 +338,8 @@  image_from_pict_internal(PicturePtr pict, Bool has_clip, int *xoff, int *yoff,
 				image = create_conical_gradient_image(gradient);
 		}
 		*xoff = *yoff = 0;
+	} else {
+		*xoff = *yoff = 0;
 	}
 
 	if (image)