[Mesa-dev] [PATCH] mesa: Fix valgrind uninitialized variable warning

Ian Romanick idr at freedesktop.org
Fri Feb 14 12:51:56 PST 2014


On 02/14/2014 08:05 AM, Courtney Goeltzenleuchter wrote:
> Initialize field to eliminate valgrind warning.

There are a couple other fields that aren't set it all paths (e.g.,
flipped).  I want to suggest just memseting the whole structure, but
it's not obvious to me how it's used throughout the code.

I suspect the code was more clear before ETC2 support was added...

> Signed-off-by: Courtney Goeltzenleuchter <courtney at LunarG.com>
> ---
>  src/mesa/main/texcompress_etc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/mesa/main/texcompress_etc.c b/src/mesa/main/texcompress_etc.c
> index f9234b0..97adc86 100644
> --- a/src/mesa/main/texcompress_etc.c
> +++ b/src/mesa/main/texcompress_etc.c
> @@ -350,6 +350,7 @@ etc2_rgb8_parse_block(struct etc2_block *block,
>     block->is_t_mode = false;
>     block->is_h_mode = false;
>     block->is_planar_mode = false;
> +   block->opaque = false;
>  
>     if (punchthrough_alpha)
>        block->opaque = src[3] & 0x2;
> 



More information about the mesa-dev mailing list