diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2014-08-22 19:49:38 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2014-08-22 20:14:59 +0900 |
commit | 683834cfc4a3b60ce9c5790bfbd232f591897e92 (patch) | |
tree | 62de3113a3fa70de1c9babc34b9e5f5a89f68b0f | |
parent | 91c0198273b906df15899eb61a7b1b39c46a2968 (diff) |
ephysics - fix null dereference
this fixes a real bug in ephysics where we explicitly deref a null
ponter. fix CID 1039418
-rw-r--r-- | src/lib/ephysics/ephysics_body.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/lib/ephysics/ephysics_body.cpp b/src/lib/ephysics/ephysics_body.cpp index e7cb00d4a9..48ef8cf417 100644 --- a/src/lib/ephysics/ephysics_body.cpp +++ b/src/lib/ephysics/ephysics_body.cpp | |||
@@ -2122,13 +2122,7 @@ _ephysics_body_soft_body_add(EPhysics_World *world, btCollisionShape *collision_ | |||
2122 | 2122 | ||
2123 | body = _ephysics_body_rigid_body_add(world, collision_shape, "soft box", 0.5, | 2123 | body = _ephysics_body_rigid_body_add(world, collision_shape, "soft box", 0.5, |
2124 | 0.5, 0.5); | 2124 | 0.5, 0.5); |
2125 | if (!body) | 2125 | if (!body) return NULL; |
2126 | { | ||
2127 | if (body->deleted) return NULL; | ||
2128 | body->deleted = EINA_TRUE; | ||
2129 | ephysics_world_body_del(body->world, body); | ||
2130 | return NULL; | ||
2131 | } | ||
2132 | 2126 | ||
2133 | body->material_index = 0; | 2127 | body->material_index = 0; |
2134 | body->type = EPHYSICS_BODY_TYPE_SOFT; | 2128 | body->type = EPHYSICS_BODY_TYPE_SOFT; |