forked from len0rd/rockbox
Fix use of uninitialized memory in xlcd_scroll_left() / xlcd_scroll_right() in special cases
Only valid for: LCD_PIXELFORMAT == HORIZONTAL_PACKING && LCD_DEPTH != 2 Found by "cppcheck". git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30348 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4ccb6e4f27
commit
bc6dd127e3
1 changed files with 6 additions and 6 deletions
|
@ -138,15 +138,15 @@ void xlcd_scroll_down(int count)
|
||||||
/* Scroll left */
|
/* Scroll left */
|
||||||
void xlcd_scroll_left(int count)
|
void xlcd_scroll_left(int count)
|
||||||
{
|
{
|
||||||
int bitcount, oldmode;
|
int bitcount=0, oldmode;
|
||||||
int blockcount, blocklen;
|
int blockcount=0, blocklen;
|
||||||
|
|
||||||
if ((unsigned) count >= LCD_WIDTH)
|
if ((unsigned) count >= LCD_WIDTH)
|
||||||
{
|
{
|
||||||
rb->lcd_clear_display();
|
rb->lcd_clear_display();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LCD_DEPTH == 2
|
#if LCD_DEPTH == 2
|
||||||
blockcount = count >> 2;
|
blockcount = count >> 2;
|
||||||
blocklen = LCD_FBWIDTH - blockcount;
|
blocklen = LCD_FBWIDTH - blockcount;
|
||||||
|
@ -196,15 +196,15 @@ void xlcd_scroll_left(int count)
|
||||||
/* Scroll right */
|
/* Scroll right */
|
||||||
void xlcd_scroll_right(int count)
|
void xlcd_scroll_right(int count)
|
||||||
{
|
{
|
||||||
int bitcount, oldmode;
|
int bitcount=0, oldmode;
|
||||||
int blockcount, blocklen;
|
int blockcount=0, blocklen;
|
||||||
|
|
||||||
if ((unsigned) count >= LCD_WIDTH)
|
if ((unsigned) count >= LCD_WIDTH)
|
||||||
{
|
{
|
||||||
rb->lcd_clear_display();
|
rb->lcd_clear_display();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LCD_DEPTH == 2
|
#if LCD_DEPTH == 2
|
||||||
blockcount = count >> 2;
|
blockcount = count >> 2;
|
||||||
blocklen = LCD_FBWIDTH - blockcount;
|
blocklen = LCD_FBWIDTH - blockcount;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue