[Mesa-dev] [PATCH] mesa: fix crash in driver_RenderTexture_is_safe

Nicolai Hähnle nhaehnle at gmail.com
Tue May 31 11:41:41 UTC 2016


On 30.05.2016 16:30, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> This just fixed the crash with the apitrace in bug report.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95246
>
> Cc: 11.1 11.2 <mesa-stable at lists.freedesktop.org>

12.0 as well, I expect.

Apart from that,

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

> ---
>   src/mesa/main/fbobject.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index fa5baa3..bf47c1c 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -389,7 +389,8 @@ driver_RenderTexture_is_safe(const struct gl_renderbuffer_attachment *att)
>      const struct gl_texture_image *const texImage =
>         att->Texture->Image[att->CubeMapFace][att->TextureLevel];
>
> -   if (texImage->Width == 0 || texImage->Height == 0 || texImage->Depth == 0)
> +   if (!texImage ||
> +       texImage->Width == 0 || texImage->Height == 0 || texImage->Depth == 0)
>         return false;
>
>      if ((texImage->TexObject->Target == GL_TEXTURE_1D_ARRAY
>


More information about the mesa-dev mailing list