We were trying to read twice as many as the X server sent us, which
upset XCB:
[xcb] Too much data requested from _XRead
[xcb] This is most likely caused by a broken X extension library
[xcb] Aborting, sorry about that.
glx-free-context: ../../src/xcb_io.c:732: _XRead: Assertion `!xcb_xlib_too_much_data_requested' failed.
Fixing this takes 3 GLX piglit tests from crash to pass.
Fixes: 085216295033 "glx: Be more tolerant in glXImportContext (v2)"
Reviewed-by: Adam Jackson <ajax@redhat.com>
if (_XReply(dpy, (xReply *) & reply, 0, False) &&
reply.n < (INT32_MAX / 2)) {
- for (i = 0; i < reply.n * 2; i++) {
+ for (i = 0; i < reply.n; i++) {
int prop[2];
_XRead(dpy, (char *)prop, sizeof(prop));