projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e34a54f
)
swrast: new assertions in _swrast_pixel_address()
author
Brian Paul
<brianp@vmware.com>
Mon, 16 Jan 2012 17:54:53 +0000
(10:54 -0700)
committer
Brian Paul
<brianp@vmware.com>
Tue, 24 Jan 2012 21:12:11 +0000
(14:12 -0700)
src/mesa/swrast/s_context.h
patch
|
blob
|
history
diff --git
a/src/mesa/swrast/s_context.h
b/src/mesa/swrast/s_context.h
index 3391600e1207f63d8fcc6ee33308a852816f4d57..36ab86a5e848fbd9a339d86a1c654976f28e554d 100644
(file)
--- a/
src/mesa/swrast/s_context.h
+++ b/
src/mesa/swrast/s_context.h
@@
-430,6
+430,14
@@
_swrast_pixel_address(struct gl_renderbuffer *rb, GLint x, GLint y)
{
const GLint bpp = _mesa_get_format_bytes(rb->Format);
const GLint rowStride = rb->RowStride * bpp;
+ assert(x >= 0);
+ assert(y >= 0);
+ /* NOTE: using <= only because of s_tritemp.h which gets a pixel
+ * address but doesn't necessarily access it.
+ */
+ assert(x <= (GLint) rb->Width);
+ assert(y <= (GLint) rb->Height);
+ assert(rb->Data);
return (GLubyte *) rb->Data + y * rowStride + x * bpp;
}