diff options
| author | Magnus Holmgren <magnushol@gmail.com> | 2006-12-17 15:40:13 +0000 |
|---|---|---|
| committer | Magnus Holmgren <magnushol@gmail.com> | 2006-12-17 15:40:13 +0000 |
| commit | c0b28629565de55084a1c6c5d2ce387490032e7d (patch) | |
| tree | c799b971d9c51f2a478bac4a6b919ed7bb9fbbbf | |
| parent | 84a013ea419efd0373846741b812d7ccf78881b9 (diff) | |
| download | rockbox-c0b28629565de55084a1c6c5d2ce387490032e7d.zip rockbox-c0b28629565de55084a1c6c5d2ce387490032e7d.tar.gz rockbox-c0b28629565de55084a1c6c5d2ce387490032e7d.tar.bz2 rockbox-c0b28629565de55084a1c6c5d2ce387490032e7d.tar.xz | |
Fix freeze/crash problems when scrolling very long strings (like filenames or tags).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11789 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/bidi.c | 4 | ||||
| -rw-r--r-- | firmware/export/lcd.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/firmware/bidi.c b/firmware/bidi.c index a6f6b8c..b5851f2 100644 --- a/firmware/bidi.c +++ b/firmware/bidi.c @@ -131,8 +131,8 @@ void arabjoin(unsigned short * stringprt, int length){ unsigned short *bidi_l2v(const unsigned char *str, int orientation) { int length = utf8length(str); - static unsigned short utf16_buf[MAX_PATH+1]; - static unsigned short bidi_buf[MAX_PATH+1]; + static unsigned short utf16_buf[SCROLL_LINE_SIZE]; + static unsigned short bidi_buf[SCROLL_LINE_SIZE]; unsigned short *heb_str, *target, *tmp; // *broken_str int block_start, block_end, block_type, block_length, i; //long max_chars=0; diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index 1ccbc51..3e1ea44 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h @@ -367,9 +367,10 @@ extern void lcd_bitmap_transparent(const fb_data *src, int x, int y, /* internal usage, but in multiple drivers */ #ifdef HAVE_LCD_BITMAP #define SCROLL_SPACING 3 +#define SCROLL_LINE_SIZE (MAX_PATH + LCD_WIDTH/2 + SCROLL_SPACING + 2) struct scrollinfo { - char line[MAX_PATH + LCD_WIDTH/2 + SCROLL_SPACING + 2]; + char line[SCROLL_LINE_SIZE]; int len; /* length of line in chars */ int width; /* length of line in pixels */ int offset; |