From: Axel Davy Date: Sun, 25 Nov 2018 13:37:53 +0000 (+0100) Subject: st/nine: Fix volumetexture dtor on ctor failure X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f91f748fabd7fec8f571124df23296c07102a983;p=mesa.git st/nine: Fix volumetexture dtor on ctor failure The dtor is called on allocation failure, thus we must check the volumes are allocated before trying to release them. Signed-off-by: Axel Davy Tested-by: Dieter Nützel Cc: mesa-stable@lists.freedesktop.org --- diff --git a/src/gallium/state_trackers/nine/volumetexture9.c b/src/gallium/state_trackers/nine/volumetexture9.c index 5dec4844864..c7191bce688 100644 --- a/src/gallium/state_trackers/nine/volumetexture9.c +++ b/src/gallium/state_trackers/nine/volumetexture9.c @@ -141,7 +141,8 @@ NineVolumeTexture9_dtor( struct NineVolumeTexture9 *This ) if (This->volumes) { for (l = 0; l <= This->base.base.info.last_level; ++l) - NineUnknown_Destroy(&This->volumes[l]->base); + if (This->volumes[l]) + NineUnknown_Destroy(&This->volumes[l]->base); FREE(This->volumes); }