diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c index c84c29c22d..6ce3e3767f 100644 --- a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c +++ b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c | |||
@@ -501,6 +501,12 @@ void lcd_update_rect(int x, int y, int w, int h) | |||
501 | if(!lcd_on) | 501 | if(!lcd_on) |
502 | return; | 502 | return; |
503 | #endif | 503 | #endif |
504 | /* make sure the rectangle is included in the screen */ | ||
505 | x = MIN(x, LCD_WIDTH); | ||
506 | y = MIN(y, LCD_HEIGHT); | ||
507 | w = MIN(w, LCD_WIDTH - x); | ||
508 | h = MIN(h, LCD_HEIGHT - y); | ||
509 | |||
504 | imx233_lcdif_wait_ready(); | 510 | imx233_lcdif_wait_ready(); |
505 | lcd_write_reg(0x50, x); | 511 | lcd_write_reg(0x50, x); |
506 | lcd_write_reg(0x51, x + w - 1); | 512 | lcd_write_reg(0x51, x + w - 1); |