[Mesa-dev] [PATCH] mesa: use signed temporary variable to store _ColorDrawBufferIndexes

Emil Velikov emil.l.velikov at gmail.com
Sun Jan 12 15:01:28 PST 2014


On 12/01/14 22:52, Emil Velikov wrote:
> _ColorDrawBufferIndexes is defined as GLint* and using a GLuint*
> will result in the first part of the conditional to be evaluated to
> true always.
> 
> Unintentionally introduced by the following commit, this will result
> in a driver segfault if one is using an old version of the piglit test
> 
>     bin/clearbuffer-mixed-format -auto -fbo
> 
And by old, my piglit was at e696687133c02b1e16ae198101ac04cd5fd6eb41
when I ran into this problem.

Emil

> commit 03d848ea1003abefd8fe51a5b4a780527cd852af
> Author: Marek Olšák <marek.olsak at amd.com>
> Date:   Wed Dec 4 00:27:20 2013 +0100
> 
>     mesa: fix interpretation of glClearBuffer(drawbuffer)
> 
>     This corresponding piglit tests supported this incorrect behavior instead of
>     pointing at it.
> 
> Cc: Marek Olšák <marek.olsak at amd.com>
> Cc: 10.0 9.2 9.1 <mesa-stable at lists.freedesktop.org>
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
>  src/mesa/main/clear.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
> index f0b525f..d568ed8 100644
> --- a/src/mesa/main/clear.c
> +++ b/src/mesa/main/clear.c
> @@ -274,7 +274,7 @@ make_color_buffer_mask(struct gl_context *ctx, GLint drawbuffer)
>        break;
>     default:
>        {
> -         GLuint buf = ctx->DrawBuffer->_ColorDrawBufferIndexes[drawbuffer];
> +         GLint buf = ctx->DrawBuffer->_ColorDrawBufferIndexes[drawbuffer];
>  
>           if (buf >= 0 && att[buf].Renderbuffer) {
>              mask |= 1 << buf;
> 



More information about the mesa-dev mailing list