star-3d

Surface structuring for efficient 3D geometric queries
git clone git://git.meso-star.fr/star-3d.git
Log | Files | Refs | README | LICENSE

commit 332dff54eed2e32a406010ecbdfbd5983b711733
parent 6acf488d4716fa97b284ca8fab30e77cf8d6ee10
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue, 13 Oct 2015 13:03:56 +0200

Fix a memory read corruption on the detachment of a shape

If the shape to detach was owned by the scene only, it was destroyed
while its data were still read.

Diffstat:
Msrc/s3d_scene.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/s3d_scene.c b/src/s3d_scene.c @@ -328,12 +328,13 @@ scene_detach_shape(struct s3d_scene* scn, struct s3d_shape* shape) htable_geom_erase(&scn->cached_geoms, &shape); } list_del(&shape->scene_attachment); - S3D(shape_ref_put(shape)); if(shape->type == GEOM_INSTANCE) { ASSERT(scn->instances_count != 0); --scn->instances_count; } + + S3D(shape_ref_put(shape)); } static res_T