swrast: Fix use of uninitialized value in rbmapping changes.
authorEric Anholt <eric@anholt.net>
Thu, 5 Jan 2012 01:11:33 +0000 (17:11 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 6 Jan 2012 17:49:01 +0000 (09:49 -0800)
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@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/swrast/s_copypix.c

index a14b44b9d2406ae67c5cb13514c27c31f6f507ca..1e0f9fe7d1f42abd216b5d4f93ec87c8c7d1fc0c 100644 (file)
@@ -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 */
       }