From: Vinson Lee Date: Sun, 21 Feb 2010 10:13:15 +0000 (-0800) Subject: mesa: Add assert to check for null pointer dereference. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7da9da190f44f504db13570c0cec05dffa240cae;p=mesa.git mesa: Add assert to check for null pointer dereference. --- diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 065e25fd332..269bc9ac6ca 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)