diff options
author | Axel Davy <davyaxel0@gmail.com> | 2021-03-12 13:47:09 +0100 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-04-14 08:33:13 +0000 |
commit | 29cc19e54f482def8248703848b2663feb14b9da (patch) | |
tree | ca1b0130b49fa153cb9bbaa9e8473f8883934cf4 | |
parent | 204bc8981f78206ad6c12ca628c59c3645ec0e0c (diff) |
st/nine: Fix cubetexture early destruction
When the surface creation fails, the dtor
can face NULL pointers for the surfaces.
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>
-rw-r--r-- | src/gallium/frontends/nine/cubetexture9.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/frontends/nine/cubetexture9.c b/src/gallium/frontends/nine/cubetexture9.c index 0e87acd2151..ae55d07d597 100644 --- a/src/gallium/frontends/nine/cubetexture9.c +++ b/src/gallium/frontends/nine/cubetexture9.c @@ -179,7 +179,8 @@ NineCubeTexture9_dtor( struct NineCubeTexture9 *This ) if (This->surfaces) { for (i = 0; i < This->base.level_count * 6; ++i) - NineUnknown_Destroy(&This->surfaces[i]->base.base); + if (This->surfaces[i]) + NineUnknown_Destroy(&This->surfaces[i]->base.base); FREE(This->surfaces); } |