summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Crouse <jordan@cosmicpenguin.net>2008-11-18 15:41:58 -0700
committerJordan Crouse <jordan@cosmicpenguin.net>2008-11-18 15:43:57 -0700
commitaac2e161818494b88677f11115bca890a552c709 (patch)
treec9dfbdb6c447425937414c68d2546042efa04aa3
parentfc772694ec04f729b5a1cdced7f33dc406c1d67f (diff)
LX: Fix a bug in the memory allocator
-rw-r--r--src/lx_memory.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lx_memory.c b/src/lx_memory.c
index d71a9a4..9ec8c2b 100644
--- a/src/lx_memory.c
+++ b/src/lx_memory.c
@@ -96,7 +96,9 @@ GeodeAllocRemainder(GeodeRec * pGeode)
nptr = xcalloc(1, sizeof(*nptr));
nptr->offset = ptr->offset + ptr->size;
- nptr->size = pGeode->offscreenSize - nptr->offset;
+ nptr->size = pGeode->offscreenSize -
+ (nptr->offset - pGeode->offscreenStart);
+
nptr->next = ptr->next;
nptr->prev = ptr;
ptr->next = nptr;