From 1dabca6c267c2f8dfc8c0fb9269877856c00d4f1 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Thu, 8 Aug 2019 00:10:34 -0400 Subject: [PATCH] sdl: document some pointer voodoo This was lifted straight from pictureflow... Change-Id: Ie09184390e6fcea007e7daea001f075de307f878 --- apps/plugins/sdl/main.c | 2 ++ 1 file changed, 2 insertions(+) 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;