summaryrefslogtreecommitdiff
path: root/apps/plugins/rockpaint.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/rockpaint.c')
-rw-r--r--apps/plugins/rockpaint.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/apps/plugins/rockpaint.c b/apps/plugins/rockpaint.c
index d762737ce4..264e4f6b14 100644
--- a/apps/plugins/rockpaint.c
+++ b/apps/plugins/rockpaint.c
@@ -3031,12 +3031,18 @@ static int save_bitmap( char *file )
3031enum plugin_status plugin_start(const void* parameter) 3031enum plugin_status plugin_start(const void* parameter)
3032{ 3032{
3033 size_t buffer_size; 3033 size_t buffer_size;
3034 buffer = (buf*) 3034 buffer = (buf*) (((uintptr_t)rb->plugin_get_buffer(&buffer_size) + 3) & ~3);
3035 (((uintptr_t)rb->plugin_get_audio_buffer(&buffer_size) + 3) & ~3);
3036 if (buffer_size < sizeof(*buffer) + 3) 3035 if (buffer_size < sizeof(*buffer) + 3)
3037 { 3036 {
3038 rb->splash(HZ, "Not enough memory"); 3037 /* steal from audiobuffer if plugin buffer is too small */
3039 return PLUGIN_ERROR; 3038 buffer = (buf*)
3039 (((uintptr_t)rb->plugin_get_audio_buffer(&buffer_size) + 3) & ~3);
3040
3041 if (buffer_size < sizeof(*buffer) + 3)
3042 {
3043 rb->splash(HZ, "Not enough memory");
3044 return PLUGIN_ERROR;
3045 }
3040 } 3046 }
3041 3047
3042 rb->lcd_set_foreground(COLOR_WHITE); 3048 rb->lcd_set_foreground(COLOR_WHITE);