diff options
-rw-r--r-- | external/libgltf/UnpackedTarball_libgltf.mk | 1 | ||||
-rw-r--r-- | external/libgltf/patches/stop_a_potential_memory_leak.patch | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/external/libgltf/UnpackedTarball_libgltf.mk b/external/libgltf/UnpackedTarball_libgltf.mk index 2e027ad2a47f..f1e618c23b80 100644 --- a/external/libgltf/UnpackedTarball_libgltf.mk +++ b/external/libgltf/UnpackedTarball_libgltf.mk @@ -32,6 +32,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,libgltf,\ external/libgltf/patches/fix_package_file.patch \ external/libgltf/patches/comma_at_end_of_enumerator_list.patch \ external/libgltf/patches/extra_semicolon.patch \ + external/libgltf/patches/stop_a_potential_memory_leak.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libgltf/patches/stop_a_potential_memory_leak.patch b/external/libgltf/patches/stop_a_potential_memory_leak.patch new file mode 100644 index 000000000000..1dff583410bc --- /dev/null +++ b/external/libgltf/patches/stop_a_potential_memory_leak.patch @@ -0,0 +1,27 @@ +changeset: 1068:ef62f9d46016 +branch: improvement +parent: 1065:ce62a560f347 +user: LeiQu +date: Tue Jul 01 14:46:15 2014 +0800 +summary: Fix the bug of memory leak + +diff -ur libgltf.org/src/LoadScene.cpp libgltf/src/LoadScene.cpp +--- libgltf.org/src/LoadScene.cpp 2014-07-04 16:35:53.702409179 +0200 ++++ libgltf/src/LoadScene.cpp 2014-07-04 16:35:59.926408911 +0200 +@@ -1052,10 +1052,14 @@ + std::string nodeId;
+ for (; it != itEnd; ++it)
+ {
+- Animation* pAnimation = new Animation();
+ boost::property_tree::ptree pAnimTree = it->second;
+ nodeId = parseChannel(pAnimTree);
+- parsePara(pAnimTree, pAnimation, nodeId);
++ if (nodeId.empty())
++ {
++ continue;
++ }
++ Animation* pAnimation = new Animation();
++ parsePara(pAnimTree, pAnimation, nodeId);
+ this->pScene->insertAnimMap(nodeId, pAnimation);
+ }
+ return true;
|