From 4d48ebe22eccdd612a8e9d3366d8cf34795050f6 Mon Sep 17 00:00:00 2001 From: Roland Baer Date: Tue, 7 Aug 2007 11:32:05 +0300 Subject: [PATCH] Moved usage after explicit NULL check --- src/mesa/drivers/dri/unichrome/via_context.c | 9 +++++---- 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 4d25d32..61d356f 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 *const draw_buffer; + struct via_renderbuffer *const 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: -- 1.5.2.3