added a couple new assertions to help debug XGL problem
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 10 Jan 2006 15:48:56 +0000 (15:48 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 10 Jan 2006 15:48:56 +0000 (15:48 +0000)
src/mesa/drivers/x11/xm_api.c

index 2bcbd2c3b01f9c0de30914d5a030a877c95a11aa..437c9e284611bce142e609d002fb11bdc8d47af6 100644 (file)
@@ -253,6 +253,7 @@ static int bits_per_pixel( XMesaVisual xmv )
 {
    const int depth = xmv->nplanes;
    int i;
+   assert(depth > 0);
    for (i = 0; i < screenInfo.numPixmapFormats; i++) {
       if (screenInfo.formats[i].depth == depth)
          return screenInfo.formats[i].bitsPerPixel;
@@ -1563,6 +1564,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
     * ColormapEntries is either (1U << index_bits) or
     * (1U << max(redBits, greenBits, blueBits)).
     */
+   assert(visinfo->nplanes > 0);
    v->nplanes = visinfo->nplanes;
    v->ColormapEntries = visinfo->ColormapEntries;