Add a check which compares the passed in size of the DDX driver private DRI
authorAlan Hourihane <alanh@tungstengraphics.com>
Sun, 14 Aug 2005 12:16:51 +0000 (12:16 +0000)
committerAlan Hourihane <alanh@tungstengraphics.com>
Sun, 14 Aug 2005 12:16:51 +0000 (12:16 +0000)
structure to the 3D drivers view of it, and abort if they don't match.

This traps the case with the drmAddress removal in the DDX driver.

src/mesa/drivers/dri/i915/intel_screen.c

index 6c3f2f577447597d48dccd623a4d73ab4b03c80a..61166fe2a6c74e6c8b8ed19ed2e3360ec9b14841 100644 (file)
@@ -79,6 +79,10 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
      (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
    void * const psc = sPriv->psc->screenConfigs;
 
+   if (sPriv->devPrivSize != sizeof(I830DRIRec)) {
+      fprintf(stderr,"\nERROR!  sizeof(I830DRIRec) does not match passed size from 2D driver\n");
+      return GL_FALSE;
+   }
 
    /* Allocate the private area */
    intelScreen = (intelScreenPrivate *)CALLOC(sizeof(intelScreenPrivate));