summaryrefslogtreecommitdiffstats
path: root/apps/plugins
diff options
context:
space:
mode:
authorFranklin Wei <franklin@rockbox.org>2019-08-08 00:10:34 -0400
committerFranklin Wei <franklin@rockbox.org>2019-08-08 00:10:34 -0400
commit1dabca6c267c2f8dfc8c0fb9269877856c00d4f1 (patch)
treeb753791d899c2bc7792ddc0bc6a3c613f5bee93d /apps/plugins
parentcd77d9283f1a7342efc3b04f0822c4c007cec793 (diff)
downloadrockbox-1dabca6c267c2f8dfc8c0fb9269877856c00d4f1.tar.gz
rockbox-1dabca6c267c2f8dfc8c0fb9269877856c00d4f1.tar.bz2
rockbox-1dabca6c267c2f8dfc8c0fb9269877856c00d4f1.zip
sdl: document some pointer voodoo
This was lifted straight from pictureflow... Change-Id: Ie09184390e6fcea007e7daea001f075de307f878
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/sdl/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/plugins/sdl/main.c b/apps/plugins/sdl/main.c
index 69a7e71d11..4ae640356d 100644
--- a/apps/plugins/sdl/main.c
+++ b/apps/plugins/sdl/main.c
@@ -196,6 +196,8 @@ enum plugin_status plugin_start(const void *param)
size_t sz;
audiobuf = rb->plugin_get_audio_buffer(&sz);
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
+ /* We are loaded as an overlay towards the end of the audio
+ * buffer. We must take care not to overwrite ourselves. */
if ((uintptr_t)audiobuf < (uintptr_t)plugin_start_addr)
{
uint32_t tmp_size = (uintptr_t)plugin_start_addr - (uintptr_t)audiobuf;