diff options
| author | Amaury Pouly <amaury.pouly@gmail.com> | 2012-01-31 20:03:23 +0100 |
|---|---|---|
| committer | Amaury Pouly <amaury.pouly@gmail.com> | 2012-02-01 15:02:22 +0100 |
| commit | 0f02da208c519c1cd0d3028a61ae6df2d5e7346c (patch) | |
| tree | b6204e306c2b4e31b2de948fec8356d07fae8e47 | |
| parent | ca104755f55d201bce1e8f3a4a8cbc3f1a5074e2 (diff) | |
| download | rockbox-0f02da208c519c1cd0d3028a61ae6df2d5e7346c.zip rockbox-0f02da208c519c1cd0d3028a61ae6df2d5e7346c.tar.gz rockbox-0f02da208c519c1cd0d3028a61ae6df2d5e7346c.tar.bz2 rockbox-0f02da208c519c1cd0d3028a61ae6df2d5e7346c.tar.xz | |
fuze+: check rectangle coordinates in lcd_update_rect
Change-Id: I5f23063751d7650b8eefd0f37393498d9a27bd19
| -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 c84c29c..6ce3e37 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) if(!lcd_on) return; #endif + /* make sure the rectangle is included in the screen */ + x = MIN(x, LCD_WIDTH); + y = MIN(y, LCD_HEIGHT); + w = MIN(w, LCD_WIDTH - x); + h = MIN(h, LCD_HEIGHT - y); + imx233_lcdif_wait_ready(); lcd_write_reg(0x50, x); lcd_write_reg(0x51, x + w - 1); |