From: Brian Paul Date: Mon, 29 Jan 2018 21:19:44 +0000 (-0700) Subject: mesa: fix incorrect size/error test in _mesa_GetUnsignedBytevEXT() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=94843e60562c52975325f59f21cb1c8e89f2fe20;p=mesa.git mesa: fix incorrect size/error test in _mesa_GetUnsignedBytevEXT() 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 --- 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()"); }