Re: [Mesa-dev] [PATCH] svga: fix invalid memory reference in needs_to_create_zero()

2012-07-26 Thread Brian Paul
On 07/26/2012 02:39 PM, Jose Fonseca wrote: Looks good. While we're at it, we could ensure the whole key, including num_textures, gets zeroed. The bulk of Mesa/Gallium code assumes structures are zeroed at initialization, which makes it extremely easy to overlook those few places where that's

Re: [Mesa-dev] [PATCH] svga: fix invalid memory reference in needs_to_create_zero()

2012-07-26 Thread Jose Fonseca
Looks good. While we're at it, we could ensure the whole key, including num_textures, gets zeroed. The bulk of Mesa/Gallium code assumes structures are zeroed at initialization, which makes it extremely easy to overlook those few places where that's isn't true. Jose - Original Message ---

[Mesa-dev] [PATCH] svga: fix invalid memory reference in needs_to_create_zero()

2012-07-26 Thread Brian Paul
The emit->key.fkey info is only valid if we're generating a fragment shader. We should not look at it if we're generating a vertex shader. When generating a vertex shader, the value of emit->key.fkey.num_textures was garbage and the loop over num_textures would read invalid data. At best this wou