summaryrefslogtreecommitdiff
path: root/apps/buffering.c
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2024-04-10 20:51:34 +0200
committerChristian Soffke <christian.soffke@gmail.com>2024-04-13 16:19:48 +0200
commitb06073f7716373b115b4e039193ce622dbccb3a5 (patch)
tree8f865f8f39d76472efacbc36e00190c6911addea /apps/buffering.c
parent05b070b0b89e04a0287d35fd68f192fe52c31abf (diff)
downloadrockbox-b06073f7716373b115b4e039193ce622dbccb3a5.tar.gz
rockbox-b06073f7716373b115b4e039193ce622dbccb3a5.zip
buffering: ensure sufficient buffer size loading bitmaps
Commits 5aa0fc3 and 32f1418 (g#4451, g#4452) changed the amount of space that was allocated for loading bitmaps used to display album art. Testing revealed that the size of the JPEG decode buffer can reach up to (38 * 1024)B in some cases. When the limit is reached, additional space is required by the resize_on_load function. Change-Id: If93b45754a4f5948b6160f659182e4618e01912e
Diffstat (limited to 'apps/buffering.c')
-rw-r--r--apps/buffering.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/buffering.c b/apps/buffering.c
index 81b861ccf1..bf41544c56 100644
--- a/apps/buffering.c
+++ b/apps/buffering.c
@@ -975,8 +975,14 @@ int bufopen(const char *file, off_t offset, enum data_type type,
975 * TODO: don't add unncessary overhead for .bmp images! */ 975 * TODO: don't add unncessary overhead for .bmp images! */
976 size += JPEG_DECODE_OVERHEAD; 976 size += JPEG_DECODE_OVERHEAD;
977#endif 977#endif
978 } 978 /* resize_on_load requires space for 1 line + 2 spare lines */
979#ifdef HAVE_LCD_COLOR
980 size += sizeof(struct uint32_argb) * 3 * aa->dim->width;
981#else
982 size += sizeof(uint32_t) * 3 * aa->dim->width;
979#endif 983#endif
984 }
985#endif /* HAVE_ALBUMART */
980 986
981 if (size == 0) 987 if (size == 0)
982 size = filesize(fd); 988 size = filesize(fd);