st/nine: Prevent possible crash
In case NineBaseTexture9_ctor returns an error This->surfaces[l] might be NULL. Reviewed-by: Axel Davy <axel.davy@ens.fr> Signed-off-by: Patrick Rudolph <siro@das-labor.org>
This commit is contained in:
committed by
Axel Davy
parent
bc6c80e547
commit
248833ff40
@@ -229,7 +229,8 @@ NineTexture9_dtor( struct NineTexture9 *This )
|
||||
if (This->surfaces) {
|
||||
/* The surfaces should have 0 references and be unbound now. */
|
||||
for (l = 0; l <= This->base.base.info.last_level; ++l)
|
||||
NineUnknown_Destroy(&This->surfaces[l]->base.base);
|
||||
if (This->surfaces[l])
|
||||
NineUnknown_Destroy(&This->surfaces[l]->base.base);
|
||||
FREE(This->surfaces);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user