summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-07-04 16:46:23 +0200
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-07-04 16:47:38 +0200
commit8ea270213ba95544011fc3a79cc33f0511f6c62e (patch)
tree482b1807b61f169e3c57d4c635ce625706f71c46 /external
parent9feb55b662ac75209adc664ef86571c261a74ded (diff)
libgltf: Stop a memory leak
Change-Id: I7f3f5cfcdc368907670d58b07300889ea8452340
Diffstat (limited to 'external')
-rw-r--r--external/libgltf/UnpackedTarball_libgltf.mk1
-rw-r--r--external/libgltf/patches/stop_a_potential_memory_leak.patch27
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;