vl: Initialize pipe_vertex_buffer.user_buffer fields.
authorVinson Lee <vlee@freedesktop.org>
Mon, 14 May 2012 06:40:57 +0000 (23:40 -0700)
committerVinson Lee <vlee@freedesktop.org>
Mon, 14 May 2012 15:44:16 +0000 (08:44 -0700)
Fix uninitialized scalar variable defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/vl/vl_vertex_buffers.c

index 1e326a136208edb88eafd26fde232c7fe09ad023..a6e7af37bf41d83c6b8b7ae94eabc3871383af28 100644 (file)
@@ -56,6 +56,7 @@ vl_vb_upload_quads(struct pipe_context *pipe)
       PIPE_USAGE_STATIC,
       sizeof(struct vertex2f) * 4
    );
+   quad.user_buffer = NULL;
 
    if(!quad.buffer)
       return quad;
@@ -100,6 +101,7 @@ vl_vb_upload_pos(struct pipe_context *pipe, unsigned width, unsigned height)
       PIPE_USAGE_STATIC,
       sizeof(struct vertex2s) * width * height
    );
+   pos.user_buffer = NULL;
 
    if(!pos.buffer)
       return pos;
@@ -268,6 +270,7 @@ vl_vb_get_ycbcr(struct vl_vertex_buffer *buffer, int component)
    buf.stride = sizeof(struct vl_ycbcr_block);
    buf.buffer_offset = 0;
    buf.buffer = buffer->ycbcr[component].resource;
+   buf.user_buffer = NULL;
 
    return buf;
 }
@@ -282,6 +285,7 @@ vl_vb_get_mv(struct vl_vertex_buffer *buffer, int motionvector)
    buf.stride = sizeof(struct vl_motionvector);
    buf.buffer_offset = 0;
    buf.buffer = buffer->mv[motionvector].resource;
+   buf.user_buffer = NULL;
 
    return buf;
 }