diff options
author | Felix Arends <edx@rockbox.org> | 2002-06-24 15:24:28 +0000 |
---|---|---|
committer | Felix Arends <edx@rockbox.org> | 2002-06-24 15:24:28 +0000 |
commit | 3bce07ff62864cccfa195efe11bb042e4c11fbf2 (patch) | |
tree | 41bea76654c8c7edb85fbcc64926e31b69d64f34 /firmware | |
parent | 5bee7a490fd0e07e11a17b95dbbe6a51e7534c26 (diff) | |
download | rockbox-3bce07ff62864cccfa195efe11bb042e4c11fbf2.tar.gz rockbox-3bce07ff62864cccfa195efe11bb042e4c11fbf2.zip |
fixed propfonts bug which was related to illegal memory accesing of lcd_bitmap function called by lcd_clearrect.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1158 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/lcd.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/firmware/drivers/lcd.c b/firmware/drivers/lcd.c index e502c0c6b4..a228a6501b 100644 --- a/firmware/drivers/lcd.c +++ b/firmware/drivers/lcd.c | |||
@@ -644,10 +644,19 @@ void lcd_bitmap (unsigned char *src, int x, int y, int nx, int ny, | |||
644 | bool clear) | 644 | bool clear) |
645 | { | 645 | { |
646 | unsigned char *dst; | 646 | unsigned char *dst; |
647 | unsigned char *dst2 = &display[x][y/8]; | 647 | unsigned char *dst2; |
648 | unsigned int data, mask, mask2, mask3, mask4; | 648 | unsigned int data, mask, mask2, mask3, mask4; |
649 | int shift = y & 7; | 649 | int shift; |
650 | 650 | ||
651 | if (((unsigned)x >= LCD_WIDTH) || ((unsigned)y >= LCD_HEIGHT)) | ||
652 | return; | ||
653 | if (((unsigned)(x + nx)) >= LCD_WIDTH) | ||
654 | nx = LCD_WIDTH - x; | ||
655 | if (((unsigned)(y + ny)) >= LCD_HEIGHT) | ||
656 | ny = LCD_HEIGHT - y; | ||
657 | |||
658 | shift = y & 2; | ||
659 | dst2 = &display[x][y/8]; | ||
651 | ny += shift; | 660 | ny += shift; |
652 | 661 | ||
653 | /* Calculate bit masks */ | 662 | /* Calculate bit masks */ |