[Mesa-dev] [PATCH 8/9] i965: Check after malloc success in intel_miptree_alloc_hiz()

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Thu Jul 3 01:13:18 PDT 2014


Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 2ab0faa..30030d1 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -1399,6 +1399,10 @@ intel_miptree_alloc_hiz(struct brw_context *brw,
 
       for (int layer = 0; layer < mt->level[level].depth; ++layer) {
          struct intel_resolve_map *m = malloc(sizeof(struct intel_resolve_map));
+         if (!m) {
+            _mesa_error_no_memory(__func__);
+            return false;
+         }
          exec_node_init(&m->link);
          m->level = level;
          m->layer = layer;
-- 
1.8.1.2



More information about the mesa-dev mailing list