Mesa (master): st/mesa: Initialize variable.

Vinson Lee vlee at kemper.freedesktop.org
Thu Oct 20 17:13:30 PDT 2011


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Thu Oct 20 16:52:53 2011 -0700

st/mesa: Initialize variable.

ptr is uninitialized if ib is NULL.

Fixes Coverity uninitialized pointer read defect.

Reviewed-by: Jakob Bornecrantz <jakob at vmware.com>

---

 src/mesa/state_tracker/st_draw.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 20ba993..a2bff04 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -657,6 +657,8 @@ handle_fallback_primitive_restart(struct pipe_context *pipe,
       else {
          ptr = ib->ptr;
       }
+   } else {
+      ptr = NULL;
    }
 
    if (!ptr)



More information about the mesa-commit mailing list