summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinson Lee <vlee@freedesktop.org>2012-08-02 23:28:10 -0700
committerVinson Lee <vlee@freedesktop.org>2012-08-03 22:27:13 -0700
commit9d36b3abfd557d8eb6a1a571d387dd53ef64068b (patch)
tree1498a78f436a4b41308c7559f69baa6250c0d57e
parentfb85558ab1e40698bfb1aedaaf32b182560f2479 (diff)
u_blitter: Move a pointer dereference after null check.
Fixes dereference before null check defect reported by Coverity. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Marek Olšák <maraeo@gmail.com>
-rw-r--r--src/gallium/auxiliary/util/u_blitter.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index b31ac2d5cea..22a828f4dee 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -941,14 +941,15 @@ void util_blitter_copy_texture(struct blitter_context *blitter,
struct pipe_sampler_view src_templ, *src_view;
unsigned bind;
boolean is_stencil, is_depth;
- const struct util_format_description *src_desc =
- util_format_description(src->format);
+ const struct util_format_description *src_desc;
/* Give up if textures are not set. */
assert(dst && src);
if (!dst || !src)
return;
+ src_desc = util_format_description(src->format);
+
assert(src->target < PIPE_MAX_TEXTURE_TYPES);
/* Is this a ZS format? */