diff options
author | Franklin Wei <git@fwei.tk> | 2017-05-18 18:03:53 -0400 |
---|---|---|
committer | Franklin Wei <git@fwei.tk> | 2017-05-18 18:03:53 -0400 |
commit | 504346ab485e22a212a8df7e3fa73b1312528908 (patch) | |
tree | 8e3a782fc85191a8b66e072ebe011426af42b838 /apps/plugins/puzzles/rockbox.c | |
parent | 7b6f34a4561c544739c4271ecc27c1d5a7b0af7d (diff) | |
download | rockbox-504346ab485e22a212a8df7e3fa73b1312528908.tar.gz rockbox-504346ab485e22a212a8df7e3fa73b1312528908.zip |
puzzles: fix Bridges crash on Clip Zip
- small screen could lead to invalid viewport coordinates
Change-Id: I1f2a323554e4ed31f250218220b464a02bffa308
Diffstat (limited to 'apps/plugins/puzzles/rockbox.c')
-rw-r--r-- | apps/plugins/puzzles/rockbox.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/plugins/puzzles/rockbox.c b/apps/plugins/puzzles/rockbox.c index 7a29f341f0..94482cec69 100644 --- a/apps/plugins/puzzles/rockbox.c +++ b/apps/plugins/puzzles/rockbox.c | |||
@@ -86,10 +86,10 @@ static void rb_clip(void *handle, int x, int y, int w, int h) | |||
86 | if(!settings.clipoff) | 86 | if(!settings.clipoff) |
87 | { | 87 | { |
88 | LOGF("rb_clip(%d %d %d %d)", x, y, w, h); | 88 | LOGF("rb_clip(%d %d %d %d)", x, y, w, h); |
89 | clip_rect.x = x; | 89 | clip_rect.x = MAX(0, x); |
90 | clip_rect.y = y; | 90 | clip_rect.y = MAX(0, y); |
91 | clip_rect.width = w; | 91 | clip_rect.width = MIN(LCD_WIDTH, w); |
92 | clip_rect.height = h; | 92 | clip_rect.height = MIN(LCD_HEIGHT, h); |
93 | clip_rect.font = FONT_UI; | 93 | clip_rect.font = FONT_UI; |
94 | clip_rect.drawmode = DRMODE_SOLID; | 94 | clip_rect.drawmode = DRMODE_SOLID; |
95 | #if LCD_DEPTH > 1 | 95 | #if LCD_DEPTH > 1 |
@@ -663,7 +663,7 @@ static void rb_end_draw(void *handle) | |||
663 | LOGF("rb_end_draw"); | 663 | LOGF("rb_end_draw"); |
664 | 664 | ||
665 | if(need_draw_update) | 665 | if(need_draw_update) |
666 | rb->lcd_update_rect(ud_l, ud_u, ud_r - ud_l, ud_d - ud_u); | 666 | rb->lcd_update_rect(MAX(0, ud_l), MAX(0, ud_u), MIN(LCD_WIDTH, ud_r - ud_l), MIN(LCD_HEIGHT, ud_d - ud_u)); |
667 | } | 667 | } |
668 | 668 | ||
669 | static char *titlebar = NULL; | 669 | static char *titlebar = NULL; |