[Mesa-dev] [PATCH v2] mesa: Avoid read of uninitialized variable
Marek Olšák
maraeo at gmail.com
Thu Mar 2 15:29:32 UTC 2017
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Marek
On Thu, Mar 2, 2017 at 1:14 AM, Robert Foss <robert.foss at collabora.com> wrote:
> The is_color_attachement variable is later read when handling two
> separate error cases, where only one of the cases results in the
> variable being initialized.
>
> This can be avoided by giving the variable a safe default value.
>
> Coverity-Id: 1398631
> Signed-off-by: Robert Foss <robert.foss at collabora.com>
> Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
> Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
> src/mesa/main/fbobject.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index c8ec8e68a1..f73a009d62 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -3684,7 +3684,7 @@ _mesa_get_framebuffer_attachment_parameter(struct gl_context *ctx,
> GLint *params, const char *caller)
> {
> const struct gl_renderbuffer_attachment *att;
> - bool is_color_attachment;
> + bool is_color_attachment = false;
> GLenum err;
>
> /* The error code for an attachment type of GL_NONE differs between APIs.
> --
> 2.11.0.453.g787f75f05
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list