Fix wrong usage of memcpy which caused screen artifacts (#652590).

Signed-off-by: Adam Tkac <atkac@redhat.com>
This commit is contained in:
Adam Tkac 2011-04-13 14:57:19 +02:00
parent 3a8abefd95
commit 6986f49fe0
2 changed files with 60 additions and 1 deletions

View File

@ -0,0 +1,54 @@
From b08e7198dc0141b8074d8fdff681019d86655a38 Mon Sep 17 00:00:00 2001
From: Adam Tkac <atkac@redhat.com>
Date: Tue, 12 Apr 2011 16:49:43 +0200
Subject: [PATCH] Use memmove instead of memcpy in fbblt.c when memory regions
overlap.
Signed-off-by: Adam Tkac <atkac@redhat.com>
---
fb/fb.h | 4 ++++
fb/fbblt.c | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/fb/fb.h b/fb/fb.h
index eaa21ad..f68fe3b 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -66,6 +66,9 @@
} \
} while(0)
+/* XXX: Is this enough? */
+#define MEMMOVE_WRAPPED MEMCPY_WRAPPED
+
#else
#define FBPREFIX(x) fb##x
@@ -73,6 +76,7 @@
#define READ(ptr) (*(ptr))
#define MEMCPY_WRAPPED(dst, src, size) memcpy((dst), (src), (size))
#define MEMSET_WRAPPED(dst, val, size) memset((dst), (val), (size))
+#define MEMMOVE_WRAPPED(dst, src, size) memmove((dst), (src), (size))
#endif
diff --git a/fb/fbblt.c b/fb/fbblt.c
index a040298..e16c660 100644
--- a/fb/fbblt.c
+++ b/fb/fbblt.c
@@ -88,10 +88,10 @@ fbBlt (FbBits *srcLine,
if (!upsidedown)
for (i = 0; i < height; i++)
- MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
+ MEMMOVE_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
else
for (i = height - 1; i >= 0; i--)
- MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
+ MEMMOVE_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
return;
}
--
1.7.4.4

View File

@ -1,6 +1,6 @@
Name: tigervnc Name: tigervnc
Version: 1.0.90 Version: 1.0.90
Release: 2%{?dist} Release: 3%{?dist}
Summary: A TigerVNC remote display system Summary: A TigerVNC remote display system
Group: User Interface/Desktops Group: User Interface/Desktops
@ -45,6 +45,7 @@ Patch10: tigervnc11-ldnow.patch
Patch11: tigervnc11-gethomedir.patch Patch11: tigervnc11-gethomedir.patch
Patch12: tigervnc11-glx.patch Patch12: tigervnc11-glx.patch
Patch13: tigervnc11-rh692048.patch Patch13: tigervnc11-rh692048.patch
Patch14: 0001-Use-memmove-instead-of-memcpy-in-fbblt.c-when-memory.patch
%description %description
Virtual Network Computing (VNC) is a remote display system which Virtual Network Computing (VNC) is a remote display system which
@ -140,6 +141,7 @@ for all in `find . -type f -perm -001`; do
chmod -x "$all" chmod -x "$all"
done done
patch -p1 -b --suffix .vnc < %{SOURCE7} patch -p1 -b --suffix .vnc < %{SOURCE7}
%patch14 -p1 -b .memcpy
popd popd
# Use newer gettext # Use newer gettext
@ -302,6 +304,9 @@ fi
%doc LICENCE.TXT %doc LICENCE.TXT
%changelog %changelog
* Wed Apr 13 2011 Adam Tkac <atkac redhat com> - 1.0.90-3
- fix wrong usage of memcpy which caused screen artifacts (#652590)
* Fri Apr 08 2011 Adam Tkac <atkac redhat com> - 1.0.90-2 * Fri Apr 08 2011 Adam Tkac <atkac redhat com> - 1.0.90-2
- improve compatibility with vinagre client (#692048) - improve compatibility with vinagre client (#692048)