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

Marek Olšák maraeo at gmail.com
Mon Jan 29 22:17:58 UTC 2018


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Mon, Jan 29, 2018 at 10:42 PM, Brian Paul <brianp at vmware.com> 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()");
>     }
>
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list