[Mesa-dev] [PATCH] mesa: fix incorrect size/error test in _mesa_GetUnsignedBytevEXT()

Andres Rodriguez andresx7 at gmail.com
Mon Jan 29 21:52:51 UTC 2018


Reviewed-by: Andres Rodriguez <andresx7 at gmail.com>

Thanks.

On 2018-01-29 04:42 PM, Brian Paul wrote:
> 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()");
>      }
>   
> 


More information about the mesa-dev mailing list