diff options
author | Brian <[email protected]> | 2007-08-07 21:57:29 +0100 |
---|---|---|
committer | Brian <[email protected]> | 2007-08-07 21:57:29 +0100 |
commit | 90cc31f31bbc9039fcd9acab7d6e72f2c9a186bb (patch) | |
tree | ec53b50d7a7065d2d1a79ecf430277cdb146c83f /src/mesa | |
parent | 1223b75e63b0ecf72bdfa2e7c102bba4bfa398ee (diff) |
fix potential NULL dereference (bug 11879)
Diffstat (limited to 'src/mesa')
-rw-r--r-- | 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 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: |