[Mesa-dev] [PATCH] glx/dri2: fix use of uninitialized variable "api"

Stéphane Marchesin stephane.marchesin at gmail.com
Tue Jan 10 23:29:40 PST 2012


What about initializing "api" earlier in dri2_convert_glx_attribs
instead? i.e. before the first return. That should fix it also and is
cleaner.

Stéphane


On Tue, Jan 10, 2012 at 21:32, Vadim Girlin <vadimgirlin at gmail.com> wrote:
> Signed-off-by: Vadim Girlin <vadimgirlin at gmail.com>
> ---
>
> Fixes unigine heaven startup problem for me.
>
>  src/glx/dri2_glx.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
> index 10b6f52..b4efa40 100644
> --- a/src/glx/dri2_glx.c
> +++ b/src/glx/dri2_glx.c
> @@ -240,7 +240,7 @@ dri2_create_context_attribs(struct glx_screen *base,
>    uint32_t minor_ver = 1;
>    uint32_t major_ver = 2;
>    uint32_t flags = 0;
> -   unsigned api;
> +   unsigned api = __DRI_API_OPENGL;
>    uint32_t ctx_attribs[2 * 4];
>    unsigned num_ctx_attribs = 0;
>
> --
> 1.7.7.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list