From 94843e60562c52975325f59f21cb1c8e89f2fe20 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 29 Jan 2018 14:19:44 -0700 Subject: [PATCH] mesa: fix incorrect size/error test in _mesa_GetUnsignedBytevEXT() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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(). Reviewed-by: Andres Rodriguez Reviewed-by: Marek Olšák --- 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 5fee9a60bc3..bafd1e35b29 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -2064,7 +2064,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.30.2