summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2010-02-27 20:11:31 -0800
committerVinson Lee <[email protected]>2010-02-27 20:11:31 -0800
commit75dba756b2e3d6850b56376d7c183dc3277a563b (patch)
tree229250624466ff04ef7c1ff1e6fc84af3a170044
parentbfdee9cc70f21ef34ca8497d30ab72106ce43bd1 (diff)
mesa: Add asserts to check inputs to memcpy.
-rw-r--r--src/mesa/main/mipmap.c3
1 files changed, 3 insertions, 0 deletions
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,