Fix crash when debug output is enabled and sarea is notset in r200Clear
authorPauli Nieminen <suokkos@gmail.com>
Tue, 23 Jun 2009 14:43:00 +0000 (16:43 +0200)
committerJerome Glisse <jglisse@redhat.com>
Tue, 23 Jun 2009 14:43:00 +0000 (16:43 +0200)
src/mesa/drivers/dri/r200/r200_ioctl.c

index 0b3398a730e15d004c133e447db81760fc398f93..6560efdca390bbd4defbce4d4080fa4973ee4abe 100644 (file)
@@ -196,7 +196,10 @@ static void r200Clear( GLcontext *ctx, GLbitfield mask )
    GLuint orig_mask = mask;
 
    if ( R200_DEBUG & DEBUG_IOCTL ) {
-       fprintf( stderr, "r200Clear %x %d\n", mask, rmesa->radeon.sarea->pfCurrentPage);
+          if (rmesa->radeon.sarea)
+              fprintf( stderr, "r200Clear %x %d\n", mask, rmesa->radeon.sarea->pfCurrentPage);
+          else
+              fprintf( stderr, "r200Clear %x radeon->sarea is NULL\n", mask);
    }
 
    {