summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2021-03-04 09:16:13 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2021-03-04 14:25:58 +0000
commita4a5f5f33fd79ed625c280ac779f41d547846fe8 (patch)
tree2087bb4fbb786720b6d0ceb4ff8d65b66645782c /apps
parent2628155fc9947dcf463938553f057c39ccc2227a (diff)
downloadrockbox-a4a5f5f33fd79ed625c280ac779f41d547846fe8.tar.gz
rockbox-a4a5f5f33fd79ed625c280ac779f41d547846fe8.tar.bz2
rockbox-a4a5f5f33fd79ed625c280ac779f41d547846fe8.zip
Check core max allocations for valid handle
fix rolo warnings Change-Id: Ia2c669a5517aec54e5b2c0dc5934c88a4f49f2a9
Diffstat (limited to 'apps')
-rw-r--r--apps/radio/radioart.c7
-rw-r--r--apps/tagtree.c3
2 files changed, 10 insertions, 0 deletions
diff --git a/apps/radio/radioart.c b/apps/radio/radioart.c
index 87d37cd52c..1fd82dae68 100644
--- a/apps/radio/radioart.c
+++ b/apps/radio/radioart.c
@@ -33,6 +33,7 @@
#include "string-extra.h"
#include "pathfuncs.h"
#include "core_alloc.h"
+#include "splash.h"
#define MAX_RADIOART_IMAGES 10
struct radioart {
@@ -202,6 +203,12 @@ void radioart_init(bool entering_screen)
/* grab control over buffering */
size_t bufsize;
int handle = core_alloc_maximum("radioart", &bufsize, &radioart_ops);
+ if (handle <0)
+ {
+ splash(HZ, "Radioart Failed - OOM");
+ return;
+ }
+
buffering_reset(core_get_data(handle), bufsize);
buf = core_get_data(handle);
/* one-shot */
diff --git a/apps/tagtree.c b/apps/tagtree.c
index 97e0c67b62..4b118f6d0d 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -1258,6 +1258,9 @@ void tagtree_init(void)
menu = NULL;
rootmenu = -1;
tagtree_handle = core_alloc_maximum("tagtree", &tagtree_bufsize, &ops);
+ if (tagtree_handle < 0)
+ panicf("tagtree OOM");
+
if (!parse_menu(FILE_SEARCH_INSTRUCTIONS))
{
tagtree_unload(NULL);