Commit 2aec5c3c authored by Adam Jackson's avatar Adam Jackson 🥃

glx: Fix potential crashes in glXWait{GL,X}

glxc->drawPriv will be NULL if the context is direct, or if it is
current but without a bound drawable. Mesa's libGL won't normally emit
protocol for direct contexts for these calls, but a malign client could
still crash the server.
parent a0f738a6
Pipeline #37643 passed with stages
in 6 minutes and 3 seconds
......@@ -765,7 +765,7 @@ __glXDisp_WaitGL(__GLXclientState * cl, GLbyte * pc)
glFinish();
}
if (glxc && glxc->drawPriv->waitGL)
if (glxc && glxc->drawPriv && glxc->drawPriv->waitGL)
(*glxc->drawPriv->waitGL) (glxc->drawPriv);
return Success;
......@@ -789,7 +789,7 @@ __glXDisp_WaitX(__GLXclientState * cl, GLbyte * pc)
return error;
}
if (glxc && glxc->drawPriv->waitX)
if (glxc && glxc->drawPriv && glxc->drawPriv->waitX)
(*glxc->drawPriv->waitX) (glxc->drawPriv);
return Success;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment