From 5af34758e3bba55cb8c227ae1256818e8f112727 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 12 Feb 2009 20:13:09 +0100 Subject: gallium: Fix a couple of potential NULL pointer dereferences. A lot more test programs work. --- src/gallium/auxiliary/util/u_rect.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gallium/auxiliary/util/u_rect.c') diff --git a/src/gallium/auxiliary/util/u_rect.c b/src/gallium/auxiliary/util/u_rect.c index 2aceda12f89..6e24e594e46 100644 --- a/src/gallium/auxiliary/util/u_rect.c +++ b/src/gallium/auxiliary/util/u_rect.c @@ -173,10 +173,6 @@ util_surface_copy(struct pipe_context *pipe, void *dst_map; const void *src_map; - assert(dst_trans->block.size == src_trans->block.size); - assert(dst_trans->block.width == src_trans->block.width); - assert(dst_trans->block.height == src_trans->block.height); - assert(src->texture && dst->texture); if (!src->texture || !dst->texture) return; @@ -196,6 +192,10 @@ util_surface_copy(struct pipe_context *pipe, PIPE_TRANSFER_WRITE, dst_x, dst_y, w, h); + assert(dst_trans->block.size == src_trans->block.size); + assert(dst_trans->block.width == src_trans->block.width); + assert(dst_trans->block.height == src_trans->block.height); + src_map = pipe->screen->transfer_map(screen, src_trans); dst_map = pipe->screen->transfer_map(screen, dst_trans); -- cgit v1.2.3