On Sat, Mar 7, 2015 at 2:08 AM, Vinson Lee <[email protected]> wrote:
> egl_dri2.c: In function ‘dri2_bind_tex_image’:
> egl_dri2.c:1240:4: warning: ‘format’ may be used uninitialized in this 
> function [-Wmaybe-uninitialized]
>     (*dri2_dpy->tex_buffer->setTexBuffer2)(dri2_ctx->dri_context,
>     ^
>
> Signed-off-by: Vinson Lee <[email protected]>
> ---
>  src/egl/drivers/dri2/egl_dri2.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index d503196..88022e0 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -1227,6 +1227,7 @@ dri2_bind_tex_image(_EGLDriver *drv,
>        break;
>     default:
>        assert(0);
> +      format = 0;

How about

_eglError(EGL_BAD_SURFACE, "unrecognized format");
return EGL_FALSE;

And similarly for the TextureTarget below. Note that I don't really
know the code involved, but that seems to make more sense than passing
a bogus format down the line. With that, you could probably also
remove the assert.

  -ilia

>     }
>
>     switch (dri2_surf->base.TextureTarget) {
> --
> 2.3.1
>
> _______________________________________________
> mesa-dev mailing list
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to