[Mesa-dev] [PATCH] glsl: Ensure glsl_type constructors initialize gl_type.
Brian Paul
brianp at vmware.com
Fri Feb 8 06:23:54 PST 2013
On 02/08/2013 12:02 AM, Vinson Lee wrote:
> Fixes uninitialized scalar field defects reported by Coverity.
>
> Signed-off-by: Vinson Lee<vlee at freedesktop.org>
> ---
> src/glsl/glsl_types.cpp | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
> index 4a2c879..3b066d0 100644
> --- a/src/glsl/glsl_types.cpp
> +++ b/src/glsl/glsl_types.cpp
> @@ -81,6 +81,7 @@ glsl_type::glsl_type(GLenum gl_type,
>
> glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields,
> const char *name) :
> + gl_type(0),
> base_type(GLSL_TYPE_STRUCT),
> sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
> sampler_type(0), interface_packing(0),
> @@ -103,6 +104,7 @@ glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields,
>
> glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields,
> enum glsl_interface_packing packing, const char *name) :
> + gl_type(0),
> base_type(GLSL_TYPE_INTERFACE),
> sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
> sampler_type(0), interface_packing((unsigned) packing),
Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the mesa-dev
mailing list