aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2018-10-14 14:59:40 +1000
committerinmarket <andrewh@inmarket.com.au>2018-10-14 14:59:40 +1000
commit6a69c5673fff9c909eaadac6b7e2ddc93403c679 (patch)
tree72d00500643b808e8d69a4bdc328c6d72469837a
parent0f3310dd34d9c404a25c26b36708b060839e1908 (diff)
downloaduGFX-6a69c5673fff9c909eaadac6b7e2ddc93403c679.tar.gz
uGFX-6a69c5673fff9c909eaadac6b7e2ddc93403c679.tar.bz2
uGFX-6a69c5673fff9c909eaadac6b7e2ddc93403c679.zip
Fix gfxRealloc bug for RAW32 (and derivitives)
-rw-r--r--changelog.txt1
-rw-r--r--src/gos/gos_x_heap.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/changelog.txt b/changelog.txt
index 67ca0fc6..4192d6c1 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -44,6 +44,7 @@ FEATURE: Added support for ChibiOS Kernel V5
FEATURE: Added WS29EPD WaveShare E-Paper display
FIX: Fixed GQUEUE full synchronous function signatures
CHANGE: Removed label widget auto-sizing during redraw. It will still auto-size during creation
+FIX: Fixed realloc bug for RAW32 (and derivitives)
*** Release 2.8 ***
diff --git a/src/gos/gos_x_heap.c b/src/gos/gos_x_heap.c
index d7a07537..1a8f1061 100644
--- a/src/gos/gos_x_heap.c
+++ b/src/gos/gos_x_heap.c
@@ -135,7 +135,7 @@
// We need to do this the hard way
pfree = gfxAlloc(sz);
- if (pfree)
+ if (!pfree)
return 0;
memcpy(pfree, ptr, p->sz - sizeof(memslot));
gfxFree(ptr);
@@ -162,7 +162,7 @@
break;
}
}
-
+
// Find a free slot that is contiguous after and merge it into this one
for (prev = 0, pfree = freeSlots; pfree != 0; prev = pfree, pfree = NextFree(pfree)) {
if (pfree == (memslot *)((char *)p + p->sz)) {