st/nine: Fix volumetexture dtor on ctor failure
authorAxel Davy <davyaxel0@gmail.com>
Sun, 25 Nov 2018 13:37:53 +0000 (14:37 +0100)
committerAxel Davy <davyaxel0@gmail.com>
Sun, 23 Dec 2018 07:14:50 +0000 (08:14 +0100)
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 <davyaxel0@gmail.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Cc: mesa-stable@lists.freedesktop.org
src/gallium/state_trackers/nine/volumetexture9.c

index 5dec484486435cc2fed7131104f35d241c30dae0..c7191bce68853567cff0b06ad7002a3afef2c8cd 100644 (file)
@@ -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);
     }