Fix uninitialized memory problems

This commit is contained in:
Christian König 2010-10-23 14:01:13 +02:00
parent ba9caba9c8
commit de4c2b91f4
3 changed files with 7 additions and 0 deletions

View file

@ -177,6 +177,7 @@ init_pipe_state(struct vl_compositor *c)
c->fb_state.nr_cbufs = 1;
c->fb_state.zsbuf = NULL;
memset(&sampler, 0, sizeof(sampler));
sampler.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
sampler.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
sampler.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE;

View file

@ -458,6 +458,7 @@ init_pipe_state(struct vl_mpeg12_mc_renderer *r)
filters[4] = PIPE_TEX_FILTER_LINEAR;
for (i = 0; i < 5; ++i) {
memset(&sampler, 0, sizeof(sampler));
sampler.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
sampler.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
sampler.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
@ -604,6 +605,8 @@ init_buffers(struct vl_mpeg12_mc_renderer *r)
);
}
memset(&vertex_elems, 0, sizeof(vertex_elems));
/* Position element */
vertex_elems[0].src_offset = 0;
vertex_elems[0].instance_divisor = 0;

View file

@ -348,6 +348,7 @@ init_pipe_state(struct sp_mpeg12_context *ctx)
assert(ctx);
memset(&rast, 0, sizeof rast);
rast.flatshade = 1;
rast.flatshade_first = 0;
rast.light_twoside = 0;
@ -378,6 +379,7 @@ init_pipe_state(struct sp_mpeg12_context *ctx)
ctx->rast = ctx->pipe->create_rasterizer_state(ctx->pipe, &rast);
ctx->pipe->bind_rasterizer_state(ctx->pipe, ctx->rast);
memset(&blend, 0, sizeof blend);
blend.independent_blend_enable = 0;
blend.rt[0].blend_enable = 0;
blend.rt[0].rgb_func = PIPE_BLEND_ADD;
@ -394,6 +396,7 @@ init_pipe_state(struct sp_mpeg12_context *ctx)
ctx->blend = ctx->pipe->create_blend_state(ctx->pipe, &blend);
ctx->pipe->bind_blend_state(ctx->pipe, ctx->blend);
memset(&dsa, 0, sizeof dsa);
dsa.depth.enabled = 0;
dsa.depth.writemask = 0;
dsa.depth.func = PIPE_FUNC_ALWAYS;