diff options
-rw-r--r-- | apps/recorder/widgets.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/apps/recorder/widgets.c b/apps/recorder/widgets.c index dae9e58b32..9ee7dbc66a 100644 --- a/apps/recorder/widgets.c +++ b/apps/recorder/widgets.c | |||
@@ -28,6 +28,19 @@ void progressbar(int x, int y, int width, int height, int percent, int direction | |||
28 | { | 28 | { |
29 | int pos; | 29 | int pos; |
30 | 30 | ||
31 | /* check position and dimensions */ | ||
32 | if(x < 0) | ||
33 | return; | ||
34 | |||
35 | if(y < 0) | ||
36 | return; | ||
37 | |||
38 | if(x + width > LCD_WIDTH) | ||
39 | return; | ||
40 | |||
41 | if(y + height > LCD_HEIGHT) | ||
42 | return; | ||
43 | |||
31 | /* draw box */ | 44 | /* draw box */ |
32 | lcd_drawrect(x, y, width, height); | 45 | lcd_drawrect(x, y, width, height); |
33 | 46 | ||
@@ -76,6 +89,19 @@ void slidebar(int x, int y, int width, int height, int percent, int direction) | |||
76 | { | 89 | { |
77 | int pos; | 90 | int pos; |
78 | 91 | ||
92 | /* check position and dimensions */ | ||
93 | if(x < 0) | ||
94 | return; | ||
95 | |||
96 | if(y < 0) | ||
97 | return; | ||
98 | |||
99 | if(x + width > LCD_WIDTH) | ||
100 | return; | ||
101 | |||
102 | if(y + height > LCD_HEIGHT) | ||
103 | return; | ||
104 | |||
79 | /* draw box */ | 105 | /* draw box */ |
80 | lcd_drawrect(x, y, width, height); | 106 | lcd_drawrect(x, y, width, height); |
81 | 107 | ||
@@ -128,6 +154,19 @@ void scrollbar(int x, int y, int width, int height, int items, int min_shown, in | |||
128 | int start; | 154 | int start; |
129 | int size; | 155 | int size; |
130 | 156 | ||
157 | /* check position and dimensions */ | ||
158 | if(x < 0) | ||
159 | return; | ||
160 | |||
161 | if(y < 0) | ||
162 | return; | ||
163 | |||
164 | if(x + width > LCD_WIDTH) | ||
165 | return; | ||
166 | |||
167 | if(y + height > LCD_HEIGHT) | ||
168 | return; | ||
169 | |||
131 | /* draw box */ | 170 | /* draw box */ |
132 | lcd_drawrect(x, y, width, height); | 171 | lcd_drawrect(x, y, width, height); |
133 | 172 | ||