forked from len0rd/rockbox
fuze+: check rectangle coordinates in lcd_update_rect
Change-Id: I5f23063751d7650b8eefd0f37393498d9a27bd19
This commit is contained in:
parent
ca104755f5
commit
0f02da208c
1 changed files with 6 additions and 0 deletions
|
|
@ -501,6 +501,12 @@ void lcd_update_rect(int x, int y, int w, int h)
|
||||||
if(!lcd_on)
|
if(!lcd_on)
|
||||||
return;
|
return;
|
||||||
#endif
|
#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();
|
imx233_lcdif_wait_ready();
|
||||||
lcd_write_reg(0x50, x);
|
lcd_write_reg(0x50, x);
|
||||||
lcd_write_reg(0x51, x + w - 1);
|
lcd_write_reg(0x51, x + w - 1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue