forked from len0rd/rockbox
Check core max allocations for valid handle
fix rolo warnings Change-Id: Ia2c669a5517aec54e5b2c0dc5934c88a4f49f2a9
This commit is contained in:
parent
2628155fc9
commit
a4a5f5f33f
3 changed files with 11 additions and 1 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue