From: Vinson Lee Date: Sun, 28 Feb 2010 04:11:31 +0000 (-0800) Subject: mesa: Add asserts to check inputs to memcpy. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=75dba756b2e3d6850b56376d7c183dc3277a563b;p=mesa.git mesa: Add asserts to check inputs to memcpy. --- 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,