aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/syncobj.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-10-02 11:13:08 +0200
committermarha <marha@users.sourceforge.net>2013-10-02 11:13:08 +0200
commitc3594c6c050a987fb891a1c7cf0c83102fbbec46 (patch)
tree33b215c07359fff941f32fc89a8cf3e968d334a9 /mesalib/src/mesa/main/syncobj.c
parent1881d1a5c46cc9efb394f84b69f58c000ee1118b (diff)
parent8092f320c341a6b3a1b428fdd4473859d5db8b79 (diff)
downloadvcxsrv-c3594c6c050a987fb891a1c7cf0c83102fbbec46.tar.gz
vcxsrv-c3594c6c050a987fb891a1c7cf0c83102fbbec46.tar.bz2
vcxsrv-c3594c6c050a987fb891a1c7cf0c83102fbbec46.zip
Merge remote-tracking branch 'origin/released'
* origin/released: fontconfig mesa pixman xkeyboard-config git update 2 Okt 2013 Conflicts: mesalib/src/glsl/ast.h mesalib/src/glsl/glsl_parser_extras.h
Diffstat (limited to 'mesalib/src/mesa/main/syncobj.c')
-rw-r--r--mesalib/src/mesa/main/syncobj.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/mesalib/src/mesa/main/syncobj.c b/mesalib/src/mesa/main/syncobj.c
index 3157491bf..ae49db2e4 100644
--- a/mesalib/src/mesa/main/syncobj.c
+++ b/mesalib/src/mesa/main/syncobj.c
@@ -161,8 +161,16 @@ _mesa_free_sync_data(struct gl_context *ctx)
}
-int
-_mesa_validate_sync(struct gl_context *ctx, struct gl_sync_object *syncObj)
+/**
+ * Check if the given sync object is:
+ * - non-null
+ * - not in sync objects hash table
+ * - type is GL_SYNC_FENCE
+ * - not marked as deleted
+ */
+bool
+_mesa_validate_sync(struct gl_context *ctx,
+ const struct gl_sync_object *syncObj)
{
return (syncObj != NULL)
&& _mesa_set_search(ctx->Shared->SyncObjects,
@@ -410,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);