aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian König <[email protected]>2010-10-23 14:01:13 +0200
committerChristian König <[email protected]>2010-10-23 14:01:13 +0200
commitde4c2b91f4dd2408422bcbdbf3e9cf3897533e6d (patch)
treed013261c0959de3018bb5957d336e8fa634acb34
parentba9caba9c8b8d469dbdff677274d574b9051bc45 (diff)
Fix uninitialized memory problems
-rw-r--r--src/gallium/auxiliary/vl/vl_compositor.c1
-rw-r--r--src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c3
-rw-r--r--src/gallium/drivers/softpipe/sp_video_context.c3
3 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c
index 01d09602558..1a05f369d9b 100644
--- a/src/gallium/auxiliary/vl/vl_compositor.c
+++ b/src/gallium/auxiliary/vl/vl_compositor.c
@@ -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;
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
index 855841722c4..b6f45048a36 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
@@ -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;
diff --git a/src/gallium/drivers/softpipe/sp_video_context.c b/src/gallium/drivers/softpipe/sp_video_context.c
index 11082109cfc..ff217d66c85 100644
--- a/src/gallium/drivers/softpipe/sp_video_context.c
+++ b/src/gallium/drivers/softpipe/sp_video_context.c
@@ -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;