summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorPatrick Rudolph <[email protected]>2015-05-16 19:47:00 +0200
committerAxel Davy <[email protected]>2015-08-21 22:21:46 +0200
commit248833ff4072da4f3362dc9f0eab84eb015f3964 (patch)
tree2dd8bc4aec16f52a3ac148bf991b45e2f27b3436 /src/gallium
parentbc6c80e54714e939e4bc116374f410680e7a3632 (diff)
st/nine: Prevent possible crash
In case NineBaseTexture9_ctor returns an error This->surfaces[l] might be NULL. Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/nine/texture9.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/nine/texture9.c b/src/gallium/state_trackers/nine/texture9.c
index af97082df8d..bc325c1335e 100644
--- a/src/gallium/state_trackers/nine/texture9.c
+++ b/src/gallium/state_trackers/nine/texture9.c
@@ -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);
}