From: Pauli Nieminen Date: Mon, 31 Aug 2009 21:39:20 +0000 (+0300) Subject: radeon: Fix null pointer reference in debug system if no context is bind. X-Git-Tag: 062012170305~15523^2~309 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c4a3e036ed1c755a291018251c4f55c45ac17079;p=profile%2Fivi%2Fmesa.git radeon: Fix null pointer reference in debug system if no context is bind. --- diff --git a/src/mesa/drivers/dri/radeon/radeon_debug.c b/src/mesa/drivers/dri/radeon/radeon_debug.c index 691680e..a1ed396 100644 --- a/src/mesa/drivers/dri/radeon/radeon_debug.c +++ b/src/mesa/drivers/dri/radeon/radeon_debug.c @@ -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); }