[Piglit] [PATCH] util: Initialize vbo_data::stride in constructor.

Brian Paul brianp at vmware.com
Fri Nov 30 07:18:25 PST 2012


On 11/30/2012 12:32 AM, Vinson Lee wrote:
> Fixes uninitialized scalar field defect reported by Coverity.
>
> Signed-off-by: Vinson Lee<vlee at freedesktop.org>
> ---
>   tests/util/piglit-vbo.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/util/piglit-vbo.cpp b/tests/util/piglit-vbo.cpp
> index 2ff9c61..9749934 100644
> --- a/tests/util/piglit-vbo.cpp
> +++ b/tests/util/piglit-vbo.cpp
> @@ -442,7 +442,7 @@ vbo_data::parse_line(std::string line, unsigned int line_num, GLuint prog)
>    * then exit with PIGLIT_FAIL.
>    */
>   vbo_data::vbo_data(const std::string&text, GLuint prog)
> -	: header_seen(false), num_rows(0)
> +	: header_seen(false), stride(0), num_rows(0)
>   {
>   	unsigned int line_num = 1;
>

Looks like vbo_data::stride gets initialized to zero in
parse_header_line() but this is fine.

Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the Piglit mailing list