Fix an X server crash when starting GLX 1.3 apps;

https://bugs.freedesktop.org/show_bug.cgi?id=29091

ok matthieu@, oga@
This commit is contained in:
robert
2011-10-01 16:13:07 +00:00
parent a574170c9d
commit 1b417fdf29
2 changed files with 16 additions and 5 deletions

View File

@@ -443,7 +443,7 @@ driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config,
*/
(void) attrs;
pdp = malloc(sizeof *pdp);
pdp = calloc(1, sizeof *pdp);
if (!pdp) {
return NULL;
}

View File

@@ -102,10 +102,21 @@ static const __DRItexBufferExtension intelTexBufferExtension = {
intelSetTexBuffer2,
};
static inline struct intel_context *
to_intel_context(__DRIdrawable *drawable)
{
if (drawable->driContextPriv == NULL)
return NULL;
return drawable->driContextPriv->driverPrivate;
}
static void
intelDRI2Flush(__DRIdrawable *drawable)
{
struct intel_context *intel = drawable->driContextPriv->driverPrivate;
struct intel_context *intel = to_intel_context(drawable);
if (!intel)
return;
if (intel->gen < 4)
INTEL_FIREVERTICES(intel);
@@ -117,9 +128,9 @@ intelDRI2Flush(__DRIdrawable *drawable)
static void
intelDRI2Invalidate(__DRIdrawable *drawable)
{
struct intel_context *intel = drawable->driContextPriv->driverPrivate;
intel->using_dri2_swapbuffers = GL_TRUE;
struct intel_context *intel = to_intel_context(drawable);
if (intel)
intel->using_dri2_swapbuffers = GL_TRUE;
dri2InvalidateDrawable(drawable);
}