[Mesa-dev] [PATCH] mesa/main: Fix memset in formatquery.c

Jan Vesely jan.vesely at rutgers.edu
Fri Mar 17 05:48:00 UTC 2017


On Fri, 2017-03-17 at 16:26 +1100, Edward O'Callaghan wrote:
> We memset number of elements without multiplication by the
> element size.
> 
> Signed-off-by: Edward O'Callaghan <funfunctor at folklore1984.net>
> ---
>  src/mesa/main/formatquery.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
> index 598d34d..50d7c31 100644
> --- a/src/mesa/main/formatquery.c
> +++ b/src/mesa/main/formatquery.c
> @@ -1564,7 +1564,7 @@ _mesa_GetInternalformati64v(GLenum target, GLenum internalformat,
>      * no pname can return a negative value, we fill params32 with negative
>      * values as reference values, that can be used to know what copy-back to
>      * params */
> -   memset(params32, -1, 16);
> +   memset(params32, -1, 16*sizeof(GLint));

sizeof(params32) ?

>  
>     /* For GL_MAX_COMBINED_DIMENSIONS we need to get back 2 32-bit integers,
>      * and at the same time we only need 2. So for that pname, we call the

-- 
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170317/5372e477/attachment.sig>


More information about the mesa-dev mailing list