projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
755602d
)
mesa: check for bufSize > 0 in _mesa_GetSynciv()
author
Brian Paul
<brianp@vmware.com>
Sat, 14 Sep 2013 16:09:24 +0000
(10:09 -0600)
committer
Brian Paul
<brianp@vmware.com>
Tue, 1 Oct 2013 16:10:01 +0000
(10:10 -0600)
The spec doesn't say GL_INVALID_VALUE should be raised for bufSize <= 0.
In any case, memcpy(len < 0) will lead to a crash, so don't allow it.
CC: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/syncobj.c
patch
|
blob
|
history
diff --git
a/src/mesa/main/syncobj.c
b/src/mesa/main/syncobj.c
index 27867a13775b615d8ff56cda7253e4546366538e..ad21f3b670ab3fb9a21127f7e08d93a206204aec 100644
(file)
--- a/
src/mesa/main/syncobj.c
+++ b/
src/mesa/main/syncobj.c
@@
-418,7
+418,7
@@
_mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length,
return;
}
- if (size > 0) {
+ if (size > 0
&& bufSize > 0
) {
const GLsizei copy_count = MIN2(size, bufSize);
memcpy(values, v, sizeof(GLint) * copy_count);