From 532230f0fcbd1ac12bef476a50a5fa10e9cf9766 Mon Sep 17 00:00:00 2001 From: pinguin999 Date: Thu, 25 Sep 2014 19:00:38 +0200 Subject: [PATCH 1/3] FIX Memory access after free --- spine-sfml/src/spine/spine-sfml.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-sfml/src/spine/spine-sfml.cpp b/spine-sfml/src/spine/spine-sfml.cpp index 4543ebf84..b5b5b06de 100644 --- a/spine-sfml/src/spine/spine-sfml.cpp +++ b/spine-sfml/src/spine/spine-sfml.cpp @@ -81,8 +81,8 @@ SkeletonDrawable::SkeletonDrawable (SkeletonData* skeletonData, AnimationStateDa SkeletonDrawable::~SkeletonDrawable () { delete vertexArray; FREE(worldVertices); + if (ownsAnimationStateData) AnimationStateData_dispose(state->data); AnimationState_dispose(state); - if (ownsAnimationStateData) AnimationStateData_dispose(state->data); Skeleton_dispose(skeleton); } From 92c8dcea132b8583f591cf17a78580c337c84179 Mon Sep 17 00:00:00 2001 From: pinguin999 Date: Thu, 25 Sep 2014 19:00:57 +0200 Subject: [PATCH 2/3] FIX struct definition --- spine-c/include/spine/SkeletonData.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-c/include/spine/SkeletonData.h b/spine-c/include/spine/SkeletonData.h index 1c9822fe4..e6c46ec95 100644 --- a/spine-c/include/spine/SkeletonData.h +++ b/spine-c/include/spine/SkeletonData.h @@ -42,7 +42,7 @@ extern "C" { #endif -typedef struct { +typedef struct spSkeletonData{ const char* version; const char* hash; float width, height; From 7f6d91f90a3452469afdd33395b62c1670cd657f Mon Sep 17 00:00:00 2001 From: pinguin999 Date: Mon, 29 Sep 2014 15:11:31 +0200 Subject: [PATCH 3/3] strict compile init the struct before use --- spine-c/src/spine/Atlas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-c/src/spine/Atlas.c b/spine-c/src/spine/Atlas.c index d51cc945a..5aa3dcc43 100644 --- a/spine-c/src/spine/Atlas.c +++ b/spine-c/src/spine/Atlas.c @@ -120,7 +120,7 @@ static int readValue (const char* end, Str* str) { /* Returns the number of tuple values read (1, 2, 4, or 0 for failure). */ static int readTuple (const char* end, Str tuple[]) { int i; - Str str; + Str str = {NULL, NULL}; readLine(0, end, &str); if (!beginPast(&str, ':')) return 0;