diff options
author | Thomas Jarosch <tomj@simonv.com> | 2011-08-25 19:34:15 +0000 |
---|---|---|
committer | Thomas Jarosch <tomj@simonv.com> | 2011-08-25 19:34:15 +0000 |
commit | bc6dd127e32f61599f5becb264095f70757ae216 (patch) | |
tree | c76af74950fdc77e5928c61c6469694a45245a86 /apps/plugins | |
parent | 4ccb6e4f277eecbbd7ab2e36f71723f34b96bf05 (diff) |
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
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/lib/xlcd_scroll.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/plugins/lib/xlcd_scroll.c b/apps/plugins/lib/xlcd_scroll.c index a26e65110c..8f55f4153e 100644 --- a/apps/plugins/lib/xlcd_scroll.c +++ b/apps/plugins/lib/xlcd_scroll.c @@ -138,15 +138,15 @@ void xlcd_scroll_down(int count) /* Scroll left */ void xlcd_scroll_left(int count) { - int bitcount, oldmode; - int blockcount, blocklen; + int bitcount=0, oldmode; + int blockcount=0, blocklen; if ((unsigned) count >= LCD_WIDTH) { rb->lcd_clear_display(); return; } - + #if LCD_DEPTH == 2 blockcount = count >> 2; blocklen = LCD_FBWIDTH - blockcount; @@ -196,15 +196,15 @@ void xlcd_scroll_left(int count) /* Scroll right */ void xlcd_scroll_right(int count) { - int bitcount, oldmode; - int blockcount, blocklen; + int bitcount=0, oldmode; + int blockcount=0, blocklen; if ((unsigned) count >= LCD_WIDTH) { rb->lcd_clear_display(); return; } - + #if LCD_DEPTH == 2 blockcount = count >> 2; blocklen = LCD_FBWIDTH - blockcount; |