st/wgl: add null pointer check for HUD texture
Fixes crash when using HUD with Nobel Clinician Viewer.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
diff --git a/src/gallium/state_trackers/wgl/stw_framebuffer.c b/src/gallium/state_trackers/wgl/stw_framebuffer.c
index fbe77b2..11f60b6 100644
--- a/src/gallium/state_trackers/wgl/stw_framebuffer.c
+++ b/src/gallium/state_trackers/wgl/stw_framebuffer.c
@@ -611,7 +611,9 @@
/* Display the HUD */
struct pipe_resource *back =
stw_get_framebuffer_resource(fb->stfb, ST_ATTACHMENT_BACK_LEFT);
- hud_draw(ctx->hud, back);
+ if (back) {
+ hud_draw(ctx->hud, back);
+ }
}
if (ctx->current_framebuffer == fb) {