gallium/util: avoid unreferencing random memory on buffer alloc failure
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 26 Sep 2015 17:45:28 +0000 (13:45 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Mon, 28 Sep 2015 06:38:58 +0000 (02:38 -0400)
Found by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Albert Freeman <albertwdfreeman@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/util/u_blitter.c

index 2fbf69c67d25af631c194609cf6715260ce07446..b7b1ece389b154f4ca835a07d9672b547548177c 100644 (file)
@@ -2065,7 +2065,7 @@ void util_blitter_clear_buffer(struct blitter_context *blitter,
    struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter;
    struct pipe_context *pipe = ctx->base.pipe;
    struct pipe_vertex_buffer vb = {0};
-   struct pipe_stream_output_target *so_target;
+   struct pipe_stream_output_target *so_target = NULL;
    unsigned offsets[PIPE_MAX_SO_BUFFERS] = {0};
 
    assert(num_channels >= 1);