[PATCH] dri2: Initialize needInvalidate member of DRI2Drawable.

Rami Ylimäki rami.ylimaki at vincit.fi
Wed Aug 31 08:28:26 PDT 2011


If the client is not behaving correctly and swaps buffers before
getting them, Valgrind will complain about uninitialized memory being
used in DRI2InvalidateDrawable.

Signed-off-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
---
This may not be a huge problem in practice but it's always nice to
initialize memory fully after allocation. I haven't actually tested
this with the latest X server, I have only adapted the patch from
1.9.5.

 hw/xfree86/dri2/dri2.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index af3bcae..68eda89 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -179,6 +179,7 @@ DRI2AllocateDrawable(DrawablePtr pDraw)
     pPriv->last_swap_ust = 0;
     list_init(&pPriv->reference_list);
     pPriv->serialNumber = DRI2DrawableSerial(pDraw);
+    pPriv->needInvalidate = FALSE;
 
     if (pDraw->type == DRAWABLE_WINDOW) {
 	pWin = (WindowPtr) pDraw;
-- 
1.7.1



More information about the xorg-devel mailing list