summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLode Vandevenne <lvandeve@users.noreply.github.com>2016-04-21 12:43:17 +0200
committerLode Vandevenne <lvandeve@users.noreply.github.com>2016-04-21 12:43:17 +0200
commit24fe879cbf6812bd0dfe97c185e633f60ed92db9 (patch)
treedcddfb2eb6dc201594b08e92157c9fbc42067235
parent95a4f6983a153cff048c85cc4a109f8338b602c8 (diff)
Update lodepng.cpp
-rw-r--r--lodepng.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lodepng.cpp b/lodepng.cpp
index 08d1bfb..0e9962d 100644
--- a/lodepng.cpp
+++ b/lodepng.cpp
@@ -730,7 +730,7 @@ static BPMNode* bpmnode_create(BPMLists* lists, int weight, unsigned index, BPMN
/*sort the leaves with stable mergesort*/
static void bpmnode_sort(BPMNode* leaves, size_t num)
{
- BPMNode* mem = (BPMNode*)malloc(sizeof(*leaves) * num);
+ BPMNode* mem = (BPMNode*)lodepng_malloc(sizeof(*leaves) * num);
size_t width, counter = 0;
for(width = 1; width < num; width *= 2)
{
@@ -751,7 +751,7 @@ static void bpmnode_sort(BPMNode* leaves, size_t num)
counter++;
}
if(counter & 1) memcpy(leaves, mem, sizeof(*leaves) * num);
- free(mem);
+ lodepng_free(mem);
}
/*Boundary Package Merge step, numpresent is the amount of leaves, and c is the current chain.*/