Mesa (master): st/xorg: Don't segfault when debug printing

Jakob Bornecrantz wallbraker at kemper.freedesktop.org
Wed Nov 11 02:45:06 UTC 2009


Module: Mesa
Branch: master
Commit: 3201c655e4c393d5ae794e6373de8ef705b979a4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3201c655e4c393d5ae794e6373de8ef705b979a4

Author: Jakob Bornecrantz <jakob at vmware.com>
Date:   Tue Nov 10 08:55:26 2009 +0100

st/xorg: Don't segfault when debug printing

---

 src/gallium/state_trackers/xorg/xorg_exa.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c
index 19c0151..35fba24 100644
--- a/src/gallium/state_trackers/xorg/xorg_exa.c
+++ b/src/gallium/state_trackers/xorg/xorg_exa.c
@@ -476,9 +476,9 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture,
    debug_printf("ExaPrepareComposite(%d, src=0x%p, mask=0x%p, dst=0x%p)\n",
                 op, pSrcPicture, pMaskPicture, pDstPicture);
    debug_printf("\tFormats: src(%s), mask(%s), dst(%s)\n",
-                render_format_name(pSrcPicture->format),
-                render_format_name(pMaskPicture->format),
-                render_format_name(pDstPicture->format));
+                pSrcPicture ? render_format_name(pSrcPicture->format) : "none",
+                pMaskPicture ? render_format_name(pMaskPicture->format) : "none",
+                pDstPicture ? render_format_name(pDstPicture->format) : "none");
 #endif
    if (!exa->pipe)
       XORG_FALLBACK("accle not enabled");




More information about the mesa-commit mailing list