summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVinson Lee <vlee@vmware.com>2010-02-21 02:13:15 -0800
committerVinson Lee <vlee@vmware.com>2010-02-21 02:13:15 -0800
commit7da9da190f44f504db13570c0cec05dffa240cae (patch)
treea9a9deebd1d70bef2dfafb38d7561e869c51373b /src
parentd89de9c13fe6cd1f2f1a82d8bc0988d06e629def (diff)
mesa: Add assert to check for null pointer dereference.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/framebuffer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index 065e25fd33..269bc9ac6c 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -829,8 +829,12 @@ update_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb)
void
_mesa_update_framebuffer(GLcontext *ctx)
{
- struct gl_framebuffer *drawFb = ctx->DrawBuffer;
- struct gl_framebuffer *readFb = ctx->ReadBuffer;
+ struct gl_framebuffer *drawFb;
+ struct gl_framebuffer *readFb;
+
+ assert(ctx);
+ drawFb = ctx->DrawBuffer;
+ readFb = ctx->ReadBuffer;
update_framebuffer(ctx, drawFb);
if (readFb != drawFb)