summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-08-07 21:57:29 +0100
committerBrian <[email protected]>2007-08-07 21:57:29 +0100
commit90cc31f31bbc9039fcd9acab7d6e72f2c9a186bb (patch)
treeec53b50d7a7065d2d1a79ecf430277cdb146c83f
parent1223b75e63b0ecf72bdfa2e7c102bba4bfa398ee (diff)
fix potential NULL dereference (bug 11879)
-rw-r--r--src/mesa/drivers/dri/unichrome/via_context.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c
index 4d25d328e33..7c738777209 100644
--- a/src/mesa/drivers/dri/unichrome/via_context.c
+++ b/src/mesa/drivers/dri/unichrome/via_context.c
@@ -733,14 +733,15 @@ void viaXMesaWindowMoved(struct via_context *vmesa)
{
__DRIdrawablePrivate *const drawable = vmesa->driDrawable;
__DRIdrawablePrivate *const readable = vmesa->driReadable;
- struct via_renderbuffer *const draw_buffer =
- (struct via_renderbuffer *) drawable->driverPrivate;
- struct via_renderbuffer *const read_buffer =
- (struct via_renderbuffer *) readable->driverPrivate;
+ struct via_renderbuffer * draw_buffer;
+ struct via_renderbuffer * read_buffer;
GLuint bytePerPixel = vmesa->viaScreen->bitsPerPixel >> 3;
if (!drawable)
return;
+
+ draw_buffer = (struct via_renderbuffer *) drawable->driverPrivate;
+ read_buffer = (struct via_renderbuffer *) readable->driverPrivate;
switch (vmesa->glCtx->DrawBuffer->_ColorDrawBufferMask[0]) {
case BUFFER_BIT_BACK_LEFT: