[Mesa-dev] [PATCH 3/4] r300g: Abort if draw_create() fails

nobled nobled at dreamwidth.org
Thu Dec 2 15:09:11 PST 2010


The other drivers need to be updated to do this, too.
---
 src/gallium/drivers/r300/r300_context.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.c
b/src/gallium/drivers/r300/r300_context.c
index bb52d75..d2f8e28 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -429,6 +429,8 @@
     if (!r300screen->caps.has_tcl) {
         /* Create a Draw. This is used for SW TCL. */
         r300->draw = draw_create(&r300->context);
+        if (r300->draw == NULL)
+            goto fail;
         /* Enable our renderer. */
         draw_set_rasterize_stage(r300->draw, r300_draw_stage(r300));
         /* Disable converting points/lines to triangles. */
-- 
1.7.0.4
-------------- next part --------------
From 90fea2d64da3757ac84377bc7218a9eec21b5063 Mon Sep 17 00:00:00 2001
From: nobled <nobled at dreamwidth.org>
Date: Thu, 2 Dec 2010 22:49:05 +0000
Subject: [PATCH 3/4] r300g: Abort if draw_create() fails

The other drivers need to be updated to do this, too.
---
 src/gallium/drivers/r300/r300_context.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index bb52d75..d2f8e28 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -429,6 +429,8 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
     if (!r300screen->caps.has_tcl) {
         /* Create a Draw. This is used for SW TCL. */
         r300->draw = draw_create(&r300->context);
+        if (r300->draw == NULL)
+            goto fail;
         /* Enable our renderer. */
         draw_set_rasterize_stage(r300->draw, r300_draw_stage(r300));
         /* Disable converting points/lines to triangles. */
-- 
1.7.0.4


More information about the mesa-dev mailing list