summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/get.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 2390850a0af..77184ee7986 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1932,7 +1932,8 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
goto invalid_value;
if (!ctx->Extensions.ARB_uniform_buffer_object)
goto invalid_enum;
- v->value_int = ctx->UniformBufferBindings[index].Offset;
+ v->value_int = ctx->UniformBufferBindings[index].Offset < 0 ? 0 :
+ ctx->UniformBufferBindings[index].Offset;
return TYPE_INT;
case GL_UNIFORM_BUFFER_SIZE:
@@ -1940,7 +1941,8 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
goto invalid_value;
if (!ctx->Extensions.ARB_uniform_buffer_object)
goto invalid_enum;
- v->value_int = ctx->UniformBufferBindings[index].Size;
+ v->value_int = ctx->UniformBufferBindings[index].Size < 0 ? 0 :
+ ctx->UniformBufferBindings[index].Size;
return TYPE_INT;
/* ARB_shader_storage_buffer_object */