xorg-x11-server/N-VNC-Fix-crash-when-no-depth-translation-is-required.patch
Stefan Dirsch ebb11289e1 - update to xorg-server 1.10.4
- VNC patches completely redone by Egbert Eich (N-VNC-*)
- Xvnc-pthread.diff: small buildfix required for factory
- removed obsolete patches
  * EXA-mixed-ModifyPixmapHeader-pitch-fixes.-bug-33929.patch
  * Replace-malloc-with-calloc-to-initialize-the-buffers.patch
  * U_xserver_fix-pixmaps-lifetime-tracking.patch
  * commit-5c6a2f9.diff
  * pad-size-of-system-memory-copy-for-1x1-pixmaps
  * record-avoid-crash-when-calling-RecordFlushReplyBuff.patch
  * xorg-server-stop-cpu-eating.diff
- adjusted patches
  * bug534768-prefer_local_symbols.patch
  * zap_warning_xserver.diff
- disabled patches for now
  * 0001-Xinput-Catch-missing-configlayout-when-deleting-dev.patch
  * cache-xkbcomp-output-for-fast-start-up.patch
  * xserver-bg-none-root.patch
  * 0001-Prevent-XSync-Alarms-from-senslessly-calling-CheckTr.patch

OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=352
2011-09-06 16:02:28 +00:00

46 lines
1.6 KiB
Diff

From: Michael Schroeder <mls@suse.de>
Date: Tue, 6 Sep 2011 07:58:33 +0200
Subject: [PATCH 3/6] VNC: Fix crash when no depth translation is required.
Patch-Mainline: Currently no upstream project.
Git-commit: 74d5e3115cd955b7ee1acc64c6b8b42198ed894b
Signed-off: Egbert Eich <eich@suse.de>
References: bnc #389386
Signed-off-by: Egbert Eich <eich@freedesktop.org>
---
hw/vnc/translate.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/hw/vnc/translate.c b/hw/vnc/translate.c
index 5cc57a3..78030ed 100644
--- a/hw/vnc/translate.c
+++ b/hw/vnc/translate.c
@@ -168,17 +168,18 @@ rfbTranslateNone(ScreenPtr pScreen, char *table, rfbPixelFormat *in, rfbPixelFor
{
VNCSCREENPTR(pScreen);
DrawablePtr pDraw = (DrawablePtr)pScreen->root;
- int truewidth = PixmapBytePad(width, in->bitsPerPixel) / 4;
+ int truewidth = PixmapBytePad(width, in->bitsPerPixel);
- if ((x + truewidth > pVNC->width) || truewidth != width) {
- unsigned char *buffer = malloc(truewidth * height * in->bitsPerPixel / 8);
+ if ((x + width > pVNC->width) || truewidth != width * in->bitsPerPixel / 8) {
+ unsigned char *buffer = malloc(truewidth * height);
unsigned char *buf = buffer;
- (*pScreen->GetImage)(pDraw, x, y, truewidth, height, ZPixmap, ~0, (char*)buf);
+ (*pScreen->GetImage)(pDraw, x, y, width, height, ZPixmap, ~0, (char*)buf);
+
while (height--) {
memcpy(optr, buf, width * in->bitsPerPixel / 8);
optr += width * in->bitsPerPixel / 8;
- buf += truewidth * in->bitsPerPixel / 8;
+ buf += truewidth;
}
free(buffer);
return;
--
1.7.3.4