[Mesa-dev] [PATCH] mesa: fix incorrect size/error test in _mesa_GetUnsignedBytevEXT()
Brian Paul
brianp at vmware.com
Mon Jan 29 21:42:56 UTC 2018
get_value_size() returns -1 for an error. The similar check in
_mesa_GetUnsignedBytei_vEXT() is correct.
Found by chance. There are apparently no Piglit tests which exercise
glGetUnsignedBytei_vEXT() or glGetUnsignedBytevEXT().
---
src/mesa/main/get.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index b41fdb2..04cab91 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -2090,7 +2090,7 @@ _mesa_GetUnsignedBytevEXT(GLenum pname, GLubyte *data)
d = find_value(func, pname, &p, &v);
size = get_value_size(d->type, &v);
- if (size >= 0) {
+ if (size <= 0) {
_mesa_problem(ctx, "invalid value type in GetUnsignedBytevEXT()");
}
--
2.7.4
More information about the mesa-dev
mailing list