glx: avoid possible NULLptr deref, fix #16884
This commit is contained in:
committed by
Maarten Maathuis
parent
421b7e8f12
commit
99583b43a9
@@ -148,7 +148,9 @@ void
|
||||
__glXContextDestroy(__GLXcontext *context)
|
||||
{
|
||||
if (!context->isDirect) {
|
||||
if (context->drawPriv)
|
||||
__glXUnrefDrawable(context->drawPriv);
|
||||
if (context->readPriv)
|
||||
__glXUnrefDrawable(context->readPriv);
|
||||
}
|
||||
__glXFlushContextCache();
|
||||
@@ -621,7 +623,9 @@ DoMakeCurrent(__GLXclientState *cl,
|
||||
}
|
||||
__glXFlushContextCache();
|
||||
if (!prevglxc->isDirect) {
|
||||
if (prevglxc->drawPriv)
|
||||
__glXUnrefDrawable(prevglxc->drawPriv);
|
||||
if (prevglxc->readPriv)
|
||||
__glXUnrefDrawable(prevglxc->readPriv);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user