Mesa (master): swrast: Fix use of uninitialized value in rbmapping changes.

Eric Anholt anholt at kemper.freedesktop.org
Fri Jan 6 17:58:09 UTC 2012


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

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Jan  4 17:11:33 2012 -0800

swrast: Fix use of uninitialized value in rbmapping changes.

I'm so surprised that gcc didn't catch this that I feel like I must be
misreading.  srcMap is what we initialize (along with dstMap) from
this map value right after this check.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/swrast/s_copypix.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index a14b44b..1e0f9fe 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -500,7 +500,7 @@ swrast_fast_copy_pixels(struct gl_context *ctx,
                                   srcRb->Width, srcRb->Height,
                                   GL_MAP_READ_BIT | GL_MAP_WRITE_BIT,
                                   &map, &rowStride);
-      if (!srcMap) {
+      if (!map) {
          _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels");
          return GL_TRUE; /* don't retry with slow path */
       }




More information about the mesa-commit mailing list