From 75dba756b2e3d6850b56376d7c183dc3277a563b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 20:11:31 -0800 Subject: [PATCH] mesa: Add asserts to check inputs to memcpy. --- src/mesa/main/mipmap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 89b8c5a3563..21ee317a318 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -979,6 +979,7 @@ make_1d_mipmap(GLenum datatype, GLuint comps, GLint border, if (border) { /* copy left-most pixel from source */ + assert(dstPtr); assert(srcPtr); memcpy(dstPtr, srcPtr, bpt); /* copy right-most pixel from source */ @@ -1026,6 +1027,8 @@ make_2d_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, -- 2.30.2