summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-09-12 13:47:37 -0700
committerEric Anholt <eric@anholt.net>2008-09-12 13:49:23 -0700
commit34bba445a12f7b81654a416fd1630c8890cfc178 (patch)
tree1fb8947f4f687b98e32fdbf2875b35fc7c2e0f5a /src/mesa
parent201d3419a6432a0f35dff48e606649092afb7ff7 (diff)
intel: Don't segfault on TFP from a bad drawable.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.c3
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_image.c6
2 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index 7065bb35ee..007dee449c 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -233,6 +233,9 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
&count,
drawable->loaderPrivate);
+ if (buffers == NULL)
+ return;
+
drawable->x = 0;
drawable->y = 0;
drawable->backX = 0;
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index d1f540b0f1..70b0b3e245 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -733,6 +733,12 @@ intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv)
intel_update_renderbuffers(pDRICtx, dPriv);
rb = intel_fb->color_rb[0];
+ /* If the region isn't set, then intel_update_renderbuffers was unable
+ * to get the buffers for the drawable.
+ */
+ if (rb->region == NULL)
+ return;
+
type = GL_BGRA;
format = GL_UNSIGNED_BYTE;
internalFormat = (rb->region->cpp == 3 ? 3 : 4);