radeon: Fix null pointer reference in debug system if no context is bind.
authorPauli Nieminen <suokkos@gmail.com>
Mon, 31 Aug 2009 21:39:20 +0000 (00:39 +0300)
committerPauli Nieminen <suokkos@gmail.com>
Mon, 31 Aug 2009 21:39:20 +0000 (00:39 +0300)
src/mesa/drivers/dri/radeon/radeon_debug.c

index 691680e956b20aa7901aae5507cef6b9afca3bf7..a1ed39683f1c234bfe3f506528304aaef5437929 100644 (file)
@@ -91,8 +91,11 @@ extern void _radeon_print(const radeon_debug_type_t type,
           va_list values)
 {
        GET_CURRENT_CONTEXT(ctx);
-       radeonContextPtr radeon = RADEON_CONTEXT(ctx);
-       // FIXME: Make this multi thread safe
-       fprintf(stderr, "%s", radeon->debug.indent);
+       if (ctx) {
+               radeonContextPtr radeon = RADEON_CONTEXT(ctx);
+               // FIXME: Make this multi thread safe
+               if (radeon->debug.indent_depth)
+                       fprintf(stderr, "%s", radeon->debug.indent);
+       }
        vfprintf(stderr, message, values);
 }