Check for heap == NULL before driSetTextureSwapCounterLocation.
authorFelix Kuehling <fxkuehl@gmx.de>
Wed, 2 Feb 2005 15:57:25 +0000 (15:57 +0000)
committerFelix Kuehling <fxkuehl@gmx.de>
Wed, 2 Feb 2005 15:57:25 +0000 (15:57 +0000)
src/mesa/drivers/dri/savage/savage_xmesa.c

index 5592d0906a78ec92605496f8d2c657dfbfa96c04..1ce8a4b88fd422e35a8fb859f1c8de67ed155a3d 100644 (file)
@@ -379,8 +379,11 @@ savageCreateContext( const __GLcontextModes *mesaVis,
            &imesa->swapped,
            sizeof( savageTexObj ),
            (destroy_texture_object_t *) savageDestroyTexObj );
-       driSetTextureSwapCounterLocation( imesa->textureHeaps[i],
-                                        & imesa->c_textureSwaps );
+       /* If textureSize[i] == 0 textureHeaps[i] is NULL. This can happen
+       * if there is not enough card memory for a card texture heap. */
+       if (imesa->textureHeaps[i])
+          driSetTextureSwapCounterLocation( imesa->textureHeaps[i],
+                                            & imesa->c_textureSwaps );
    }
    imesa->texture_depth = driQueryOptioni (&imesa->optionCache,
                                           "texture_depth");