Mesa (7.9): glx: fix GLXChangeDrawableAttributesSGIX request

Brian Paul brianp at kemper.freedesktop.org
Tue Feb 22 01:20:22 UTC 2011


Module: Mesa
Branch: 7.9
Commit: ba764ae5b116efcbba26b64675a590264c89e187
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ba764ae5b116efcbba26b64675a590264c89e187

Author: Julien Cristau <jcristau at debian.org>
Date:   Wed Jan 26 04:03:16 2011 -0800

glx: fix GLXChangeDrawableAttributesSGIX request

xGLXChangeDrawableAttributesSGIXReq follows the GLXVendorPrivate header
with a drawable, number of attributes, and list of (type, value)
attribute pairs.  Don't forget to put the number of attributes in there.
I don't think this can ever have worked.

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Julien Cristau <jcristau at debian.org>
Signed-off-by: Brian Paul <brianp at vmware.com>
(cherry picked from commit e27913f805acbb7d00f83ba625a8605576738a13)

---

 src/glx/glx_pbuffer.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c
index 1de3e74..5f91bc6 100644
--- a/src/glx/glx_pbuffer.c
+++ b/src/glx/glx_pbuffer.c
@@ -117,7 +117,7 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
    else {
       xGLXVendorPrivateWithReplyReq *vpreq;
 
-      GetReqExtra(GLXVendorPrivateWithReply, 4 + (8 * num_attribs), vpreq);
+      GetReqExtra(GLXVendorPrivateWithReply, 8 + (8 * num_attribs), vpreq);
       output = (CARD32 *) (vpreq + 1);
 
       vpreq->reqType = opcode;
@@ -125,7 +125,8 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
       vpreq->vendorCode = X_GLXvop_ChangeDrawableAttributesSGIX;
 
       output[0] = (CARD32) drawable;
-      output++;
+      output[1] = num_attribs;
+      output += 2;
    }
 
    (void) memcpy(output, attribs, sizeof(CARD32) * 2 * num_attribs);




More information about the mesa-commit mailing list