mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-25 10:10:23 +01:00
mesa: check for bufSize > 0 in _mesa_GetSynciv()
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>
(cherry picked from commit 6659131be3)
This commit is contained in:
parent
26ffbf6f39
commit
2eb55601bb
1 changed files with 1 additions and 1 deletions
|
|
@ -409,7 +409,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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue