Mesa (master): radeon: Fix null pointer reference in debug system if no context is bind.
Pauli Nieminen
suokko at kemper.freedesktop.org
Mon Aug 31 21:39:38 UTC 2009
Module: Mesa
Branch: master
Commit: c4a3e036ed1c755a291018251c4f55c45ac17079
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c4a3e036ed1c755a291018251c4f55c45ac17079
Author: Pauli Nieminen <suokkos at gmail.com>
Date: Tue Sep 1 00:39:20 2009 +0300
radeon: Fix null pointer reference in debug system if no context is bind.
---
src/mesa/drivers/dri/radeon/radeon_debug.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
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);
}
More information about the mesa-commit
mailing list