summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/auxiliary/util/u_surface.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c
index a541a38ffa1..fcfff148fe4 100644
--- a/src/gallium/auxiliary/util/u_surface.c
+++ b/src/gallium/auxiliary/util/u_surface.c
@@ -160,12 +160,12 @@ util_resource_copy_region(struct pipe_context *pipe,
unsigned h = src_box->height;
assert(src && dst);
- assert((src->target == PIPE_BUFFER && dst->target == PIPE_BUFFER) ||
- (src->target != PIPE_BUFFER && dst->target != PIPE_BUFFER));
-
if (!src || !dst)
return;
+ assert((src->target == PIPE_BUFFER && dst->target == PIPE_BUFFER) ||
+ (src->target != PIPE_BUFFER && dst->target != PIPE_BUFFER));
+
src_format = src->format;
dst_format = dst->format;