Mesa (master): mesa: Add asserts to check inputs to memcpy.

Vinson Lee vlee at kemper.freedesktop.org
Thu Mar 4 08:41:52 UTC 2010


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Thu Mar  4 00:41:21 2010 -0800

mesa: Add asserts to check inputs to memcpy.

---

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

diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
index e2efe81..51f7edf 100644
--- a/src/mesa/main/mipmap.c
+++ b/src/mesa/main/mipmap.c
@@ -1325,6 +1325,8 @@ make_2d_stack_mipmap(GLenum datatype, GLuint comps, GLint border,
       if (border > 0) {
          /* fill in dest border */
          /* lower-left border pixel */
+         assert(dstPtr);
+         assert(srcPtr);
          memcpy(dstPtr, srcPtr, bpt);
          /* lower-right border pixel */
          memcpy(dstPtr + (dstWidth - 1) * bpt,




More information about the mesa-commit mailing list