diff options
author | Stefani Seibold <stefani@seibold.net> | 2009-08-06 18:07:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-08-07 13:39:55 -0400 |
commit | 93274e4d4e9416ad1fa47e2f26011e2c483fe5fe (patch) | |
tree | 0eab51b9489a19925bf03fa5f497eb8749df2645 /drivers/video | |
parent | 69dd647f969c28d18de77e2153f30d05a1874571 (diff) |
fbcon: fix rotate upside down crash
Fix the rotate_ud() function not to crash in case of a font which has not
a width of multiple by 8: The inner loop of the font pixel copy should not
access a bit outside the font memory area. Subtract the shift offset from
the font width will prevent this.
Signed-off-by: Stefani Seibold <stefani@seibold.net>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/console/fbcon_rotate.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/video/console/fbcon_rotate.h b/drivers/video/console/fbcon_rotate.h index 75be5ce53dc5..e233444cda66 100644 --- a/drivers/video/console/fbcon_rotate.h +++ b/drivers/video/console/fbcon_rotate.h | |||
@@ -45,7 +45,7 @@ static inline void rotate_ud(const char *in, char *out, u32 width, u32 height) | |||
45 | width = (width + 7) & ~7; | 45 | width = (width + 7) & ~7; |
46 | 46 | ||
47 | for (i = 0; i < height; i++) { | 47 | for (i = 0; i < height; i++) { |
48 | for (j = 0; j < width; j++) { | 48 | for (j = 0; j < width - shift; j++) { |
49 | if (pattern_test_bit(j, i, width, in)) | 49 | if (pattern_test_bit(j, i, width, in)) |
50 | pattern_set_bit(width - (1 + j + shift), | 50 | pattern_set_bit(width - (1 + j + shift), |
51 | height - (1 + i), | 51 | height - (1 + i), |