r300: Don't crash in radeonUpdatePageFlipping when !radeon->glCtx->DrawBuffer.
authorMichel Dänzer <michel@tungstengraphics.com>
Mon, 30 Apr 2007 16:28:24 +0000 (18:28 +0200)
committerMichel Dänzer <michel@tungstengraphics.com>
Mon, 30 Apr 2007 16:28:24 +0000 (18:28 +0200)
This feels like a kludge, maybe there's a better solution.

src/mesa/drivers/dri/r300/radeon_lock.c

index 84181e2e99e12a1d15f800ce1ee0c43582ebc734..0d0d9ab7f067dcf9570133e3f31b779455f6e430 100644 (file)
@@ -60,7 +60,9 @@ void radeonUpdatePageFlipping(radeonContextPtr radeon)
            r300UpdateDrawBuffer(radeon->glCtx);
         }
 
-       use_back = (radeon->glCtx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_BACK_LEFT);
+       use_back = radeon->glCtx->DrawBuffer ?
+               (radeon->glCtx->DrawBuffer->_ColorDrawBufferMask[0] ==
+                BUFFER_BIT_BACK_LEFT) : 1;
        use_back ^= (radeon->sarea->pfCurrentPage == 1);
 
        if (use_back) {