Mesa (master): nvc0: Initialize ptr for unexpected sample_count on release builds.

Vinson Lee vlee at kemper.freedesktop.org
Tue Aug 6 04:53:52 UTC 2013


Module: Mesa
Branch: master
Commit: 60b567ee59b96b9fa334bf59d3d443c29c590c54
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=60b567ee59b96b9fa334bf59d3d443c29c590c54

Author: Vinson Lee <vlee at freedesktop.org>
Date:   Sun Aug  4 00:13:53 2013 -0700

nvc0: Initialize ptr for unexpected sample_count on release builds.

Fixes "Uninitialized pointer read" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/gallium/drivers/nvc0/nvc0_context.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/nvc0/nvc0_context.c b/src/gallium/drivers/nvc0/nvc0_context.c
index cd86040..8cd5fc5 100644
--- a/src/gallium/drivers/nvc0/nvc0_context.c
+++ b/src/gallium/drivers/nvc0/nvc0_context.c
@@ -394,6 +394,7 @@ nvc0_context_get_sample_position(struct pipe_context *pipe,
    case 8: ptr = ms8; break;
    default:
       assert(0);
+      ptr = ms1;
       break;
    }
    xy[0] = ptr[sample_index][0] * 0.0625f;




More information about the mesa-commit mailing list