diff options
Diffstat (limited to 'apps/plugins/ppmviewer.c')
-rw-r--r-- | apps/plugins/ppmviewer.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/plugins/ppmviewer.c b/apps/plugins/ppmviewer.c index af66b58736..c947af10bd 100644 --- a/apps/plugins/ppmviewer.c +++ b/apps/plugins/ppmviewer.c | |||
@@ -294,11 +294,17 @@ enum plugin_status plugin_start(const void* parameter) | |||
294 | if(!parameter) return PLUGIN_ERROR; | 294 | if(!parameter) return PLUGIN_ERROR; |
295 | 295 | ||
296 | size_t buffer_size; | 296 | size_t buffer_size; |
297 | char *audiobuf = rb->plugin_get_audio_buffer(&buffer_size); | 297 | char *audiobuf = rb->plugin_get_buffer(&buffer_size); |
298 | if (buffer_size < PPM_MAXSIZE + LCD_WIDTH * LCD_HEIGHT + 1) | 298 | if (buffer_size < PPM_MAXSIZE + LCD_WIDTH * LCD_HEIGHT + 1) |
299 | { | 299 | { |
300 | rb->splash(HZ, "Not enough memory"); | 300 | /* steal from audiobuffer if plugin buffer is too small */ |
301 | return PLUGIN_ERROR; | 301 | audiobuf = rb->plugin_get_audio_buffer(&buffer_size); |
302 | |||
303 | if (buffer_size < PPM_MAXSIZE + LCD_WIDTH * LCD_HEIGHT + 1) | ||
304 | { | ||
305 | rb->splash(HZ, "Not enough memory"); | ||
306 | return PLUGIN_ERROR; | ||
307 | } | ||
302 | } | 308 | } |
303 | 309 | ||
304 | /* align on 16 bits */ | 310 | /* align on 16 bits */ |