diff options
author | William Wilgus <wilgus.william@gmail.com> | 2024-04-27 03:21:05 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2024-04-27 03:23:43 -0400 |
commit | 0dd5df4060c5a7b47391ec14b427e17626c3d615 (patch) | |
tree | 322455d660861ce1b1261401b63f560269aae55f | |
parent | 26c612f6c0e9e1f5ff4e25dc4dd6a2825bf878ba (diff) | |
download | rockbox-0dd5df4060.tar.gz rockbox-0dd5df4060.zip |
[BugFix] tlsf get_new_area should return 0u or OOM
Change-Id: I24f67a3a28237b7c1035932f69b7f526471bb8ef
-rw-r--r-- | apps/plugins/lua/tlsf_helper.c | 3 | ||||
-rw-r--r-- | lib/tlsf/src/tlsf.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/apps/plugins/lua/tlsf_helper.c b/apps/plugins/lua/tlsf_helper.c index 664d87c34e..e0da99f6fb 100644 --- a/apps/plugins/lua/tlsf_helper.c +++ b/apps/plugins/lua/tlsf_helper.c @@ -95,5 +95,6 @@ void *get_new_area(size_t *size) return audiobuf_ptr; } - return ((void *) ~0); + *size = 0; + return ((void *) ~0u); } diff --git a/lib/tlsf/src/tlsf.c b/lib/tlsf/src/tlsf.c index 7943770975..9df176ce16 100644 --- a/lib/tlsf/src/tlsf.c +++ b/lib/tlsf/src/tlsf.c @@ -469,7 +469,7 @@ static __inline__ void corrupt(const char *msg) { void * __attribute__((weak)) get_new_area(size_t * size) { (void)size; - return ((void *) ~0); + return ((void *) ~0u); } #endif |