[virglrenderer-devel] [PATCH] Fix bug which does sizeof for pointer.

Jakob Bornecrantz jakob at collabora.com
Thu Mar 22 01:01:21 UTC 2018


Thanks for this fix, this patch is both:

Tested-by: Jakob Bornecrantz <jakob at collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob at collabora.com>

Cheers, Jakob.

On 2018-03-21 21:24, Lepton Wu wrote:
> Change to use strcmp since memcmp is confusing here.
> 
> Signed-off-by: Lepton Wu <lepton at chromium.org>
> ---
>   src/vrend_shader.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/vrend_shader.c b/src/vrend_shader.c
> index a71890b..9102fb9 100644
> --- a/src/vrend_shader.c
> +++ b/src/vrend_shader.c
> @@ -2567,7 +2567,7 @@ static char *emit_ios(struct dump_ctx *ctx, char *glsl_hdr)
>            /* OpenGL ES do not support 1D texture
>             * so we use a 2D texture with a parameter set to 0.5
>             */
> -         if (ctx->cfg->use_gles && !memcmp(stc, "1D", sizeof(stc)))
> +         if (ctx->cfg->use_gles && !strcmp(stc, "1D"))
>               snprintf(buf, 255, "uniform %csampler2D %ssamp%d;\n", ptc, sname, i);
>            else
>               snprintf(buf, 255, "uniform %csampler%s %ssamp%d;\n", ptc, stc, sname, i);
> 



More information about the virglrenderer-devel mailing list