intel: Don't segfault on TFP from a bad drawable.

This commit is contained in:
Eric Anholt
2008-09-12 13:47:37 -07:00
parent 201d3419a6
commit 34bba445a1
2 changed files with 9 additions and 0 deletions
@@ -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;
@@ -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);