Skip to content

Commit

Permalink
fbcon: fix rotate upside down crash
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefani Seibold authored and Linus Torvalds committed Aug 7, 2009
1 parent 69dd647 commit 93274e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/video/console/fbcon_rotate.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static inline void rotate_ud(const char *in, char *out, u32 width, u32 height)
width = (width + 7) & ~7;

for (i = 0; i < height; i++) {
for (j = 0; j < width; j++) {
for (j = 0; j < width - shift; j++) {
if (pattern_test_bit(j, i, width, in))
pattern_set_bit(width - (1 + j + shift),
height - (1 + i),
Expand Down

0 comments on commit 93274e4

Please sign in to comment.