[Mesa-dev] [PATCH 1/5] nv50, nvc0: fix using uninitialized value 'templ.texture' in nvXX_blit_set_src()

Samuel Pitoiset samuel.pitoiset at gmail.com
Mon Dec 14 02:14:54 PST 2015


Field 'templ.texture' is used uninitialized when calling
nvXX_create_texture_view(). Spotted by Coverity.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/gallium/drivers/nouveau/nv50/nv50_surface.c | 1 +
 src/gallium/drivers/nouveau/nvc0/nvc0_surface.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/gallium/drivers/nouveau/nv50/nv50_surface.c b/src/gallium/drivers/nouveau/nv50/nv50_surface.c
index 86be1b4..b03e893 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_surface.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_surface.c
@@ -1031,6 +1031,7 @@ nv50_blit_set_src(struct nv50_blitctx *blit,
 
    target = nv50_blit_reinterpret_pipe_texture_target(res->target);
 
+   templ.texture = NULL;
    templ.format = format;
    templ.u.tex.first_level = templ.u.tex.last_level = level;
    templ.u.tex.first_layer = templ.u.tex.last_layer = layer;
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
index f8e1efb..41fb82a 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
@@ -841,6 +841,7 @@ nvc0_blit_set_src(struct nvc0_blitctx *ctx,
 
    target = nv50_blit_reinterpret_pipe_texture_target(res->target);
 
+   templ.texture = NULL;
    templ.format = format;
    templ.u.tex.first_layer = templ.u.tex.last_layer = layer;
    templ.u.tex.first_level = templ.u.tex.last_level = level;
-- 
2.6.4



More information about the mesa-dev mailing list