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 | |
parent | 4ccb6e4f277eecbbd7ab2e36f71723f34b96bf05 (diff) | |
download | rockbox-bc6dd127e32f61599f5becb264095f70757ae216.tar.gz rockbox-bc6dd127e32f61599f5becb264095f70757ae216.zip |
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
-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) | |||
138 | /* Scroll left */ | 138 | /* Scroll left */ |
139 | void xlcd_scroll_left(int count) | 139 | void xlcd_scroll_left(int count) |
140 | { | 140 | { |
141 | int bitcount, oldmode; | 141 | int bitcount=0, oldmode; |
142 | int blockcount, blocklen; | 142 | int blockcount=0, blocklen; |
143 | 143 | ||
144 | if ((unsigned) count >= LCD_WIDTH) | 144 | if ((unsigned) count >= LCD_WIDTH) |
145 | { | 145 | { |
146 | rb->lcd_clear_display(); | 146 | rb->lcd_clear_display(); |
147 | return; | 147 | return; |
148 | } | 148 | } |
149 | 149 | ||
150 | #if LCD_DEPTH == 2 | 150 | #if LCD_DEPTH == 2 |
151 | blockcount = count >> 2; | 151 | blockcount = count >> 2; |
152 | blocklen = LCD_FBWIDTH - blockcount; | 152 | blocklen = LCD_FBWIDTH - blockcount; |
@@ -196,15 +196,15 @@ void xlcd_scroll_left(int count) | |||
196 | /* Scroll right */ | 196 | /* Scroll right */ |
197 | void xlcd_scroll_right(int count) | 197 | void xlcd_scroll_right(int count) |
198 | { | 198 | { |
199 | int bitcount, oldmode; | 199 | int bitcount=0, oldmode; |
200 | int blockcount, blocklen; | 200 | int blockcount=0, blocklen; |
201 | 201 | ||
202 | if ((unsigned) count >= LCD_WIDTH) | 202 | if ((unsigned) count >= LCD_WIDTH) |
203 | { | 203 | { |
204 | rb->lcd_clear_display(); | 204 | rb->lcd_clear_display(); |
205 | return; | 205 | return; |
206 | } | 206 | } |
207 | 207 | ||
208 | #if LCD_DEPTH == 2 | 208 | #if LCD_DEPTH == 2 |
209 | blockcount = count >> 2; | 209 | blockcount = count >> 2; |
210 | blocklen = LCD_FBWIDTH - blockcount; | 210 | blocklen = LCD_FBWIDTH - blockcount; |