Skip to content

Commit

Permalink
[PATCH] tgafb: fix copying overlapping areas
Browse files Browse the repository at this point in the history
The direction of copying in the copyarea functions is selected incorrectly,
resulting in corruption.  This is a fix.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: James Simmons <jsimmons@infradead.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Maciej W. Rozycki authored and Linus Torvalds committed Feb 12, 2007
1 parent ee9a25e commit 36f7140
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/video/tgafb.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ copyarea_line_8bpp(struct fb_info *info, u32 dy, u32 sy,

n64 = (height * width) / 64;

if (dy < sy) {
if (sy < dy) {
spos = (sy + height) * width;
dpos = (dy + height) * width;

Expand Down Expand Up @@ -933,7 +933,7 @@ copyarea_line_32bpp(struct fb_info *info, u32 dy, u32 sy,

n16 = (height * width) / 16;

if (dy < sy) {
if (sy < dy) {
src = tga_fb + (sy + height) * width * 4;
dst = tga_fb + (dy + height) * width * 4;

Expand Down

0 comments on commit 36f7140

Please sign in to comment.