diff options
author | Bertrand Augereau | 2008-05-15 08:50:47 +0000 |
---|---|---|
committer | Bertrand Augereau | 2008-05-15 08:50:47 +0000 |
commit | b619c6ce1904dd814781ca601e04a36d40a3cedd (patch) | |
tree | ea7bac9bacbdc83003dc038682332ddf671d23d2 /backends/platform/ds | |
parent | 765f976008d2021cc53ce714cbec3e2160d5ef74 (diff) | |
download | scummvm-rg350-b619c6ce1904dd814781ca601e04a36d40a3cedd.tar.gz scummvm-rg350-b619c6ce1904dd814781ca601e04a36d40a3cedd.tar.bz2 scummvm-rg350-b619c6ce1904dd814781ca601e04a36d40a3cedd.zip |
NDS: Protection against FastRam (ITCM) allocation failure
svn-id: r32136
Diffstat (limited to 'backends/platform/ds')
-rw-r--r-- | backends/platform/ds/arm9/source/dsmain.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp index d11e4e6f75..55ec5004c4 100644 --- a/backends/platform/ds/arm9/source/dsmain.cpp +++ b/backends/platform/ds/arm9/source/dsmain.cpp @@ -2364,9 +2364,13 @@ u8 fastRamData[FAST_RAM_SIZE] ITCM_DATA; void* fastRamAlloc(int size) { // return malloc(size); - void* result = (void *) fastRamPointer; + void* result = fastRamPointer; fastRamPointer += size; - return (void *) (result); + if(fastRamPointer > fastRamData + FAST_RAM_SIZE) { + consolePrintf("FastRam (ITCM) allocation failed!\n"); + return NULL; + } + return result; } void fastRamReset() { |