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 | |
| parent | 5bee7a490fd0e07e11a17b95dbbe6a51e7534c26 (diff) | |
| download | rockbox-3bce07ff62864cccfa195efe11bb042e4c11fbf2.zip rockbox-3bce07ff62864cccfa195efe11bb042e4c11fbf2.tar.gz rockbox-3bce07ff62864cccfa195efe11bb042e4c11fbf2.tar.bz2 rockbox-3bce07ff62864cccfa195efe11bb042e4c11fbf2.tar.xz | |
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
| -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 e502c0c..a228a65 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, bool clear) { unsigned char *dst; - unsigned char *dst2 = &display[x][y/8]; + unsigned char *dst2; unsigned int data, mask, mask2, mask3, mask4; - int shift = y & 7; + int shift; + if (((unsigned)x >= LCD_WIDTH) || ((unsigned)y >= LCD_HEIGHT)) + return; + if (((unsigned)(x + nx)) >= LCD_WIDTH) + nx = LCD_WIDTH - x; + if (((unsigned)(y + ny)) >= LCD_HEIGHT) + ny = LCD_HEIGHT - y; + + shift = y & 2; + dst2 = &display[x][y/8]; ny += shift; /* Calculate bit masks */ |