Error checking bufSize isn't mentioned in the spec, but it is in the
man pages. However, I believe the man page is incorrect. Typically,
GL functions that take GLsizei parameters check that they're positive
or non-negative. Negative values don't make sense here.
A spec bug has been filed with Khronos/ARB.
v2: check for negative values, not <= 0.
GET_CURRENT_CONTEXT(ctx);
char **labelPtr;
+ if (bufSize < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectLabel(bufSize = %d)",
+ bufSize);
+ return;
+ }
+
labelPtr = get_label_pointer(ctx, identifier, name, "glGetObjectLabel");
if (!labelPtr)
return;
char **labelPtr;
struct gl_sync_object *const syncObj = (struct gl_sync_object *) ptr;
+ if (bufSize < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectPtrLabel(bufSize = %d)",
+ bufSize);
+ return;
+ }
+
if (!_mesa_validate_sync(ctx, syncObj)) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetObjectPtrLabel (not a valid sync object)");
return;