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 <davyaxel0@gmail.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Cc: mesa-stable@lists.freedesktop.org
This commit is contained in:
Axel Davy 2018-11-25 14:37:53 +01:00
parent 1cc8192ad0
commit f91f748fab
1 changed files with 2 additions and 1 deletions

View 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);
}