[tigervnc/f12/master] Fixed two bugs which can cause vncviewer to crash.

Adam Tkac atkac at fedoraproject.org
Wed Aug 18 12:37:04 UTC 2010


commit 2bf9327a674c52e22636c91b3c3a88a40f9219d2
Author: Adam Tkac <atkac at redhat.com>
Date:   Wed Aug 18 14:36:44 2010 +0200

    Fixed two bugs which can cause vncviewer to crash.
    
    - vncviewer: don't crash during pixel format change (#598255)
    - vncviewer: don't call setColourMapEntries when pixel format has been changed (#624866)
    
    Signed-off-by: Adam Tkac <atkac at redhat.com>

 tigervnc.spec             |   11 ++++++-
 tigervnc10-rh598255.patch |   80 +++++++++++++++++++++++++++++++++++++++++++++
 tigervnc10-rh624866.patch |   14 ++++++++
 3 files changed, 104 insertions(+), 1 deletions(-)
---
diff --git a/tigervnc.spec b/tigervnc.spec
index 1ff58d8..fbd07b3 100644
--- a/tigervnc.spec
+++ b/tigervnc.spec
@@ -1,6 +1,6 @@
 Name:		tigervnc
 Version:	1.0.1
-Release:	1%{?dist}
+Release:	2%{?dist}
 Summary:	A TigerVNC remote display system
 
 Group:		User Interface/Desktops
@@ -53,6 +53,8 @@ Patch25:	tigervnc11-r4007.patch
 Patch26:	tigervnc11-r4008.patch
 Patch27:	tigervnc11-r4024.patch
 Patch28:	tigervnc11-r4025.patch
+Patch29:	tigervnc10-rh598255.patch
+Patch30:	tigervnc10-rh624866.patch
 
 %description
 Virtual Network Computing (VNC) is a remote display system which
@@ -120,6 +122,8 @@ popd
 %patch26 -p0 -b .r4008
 %patch27 -p1 -b .r4024
 %patch28 -p1 -b .r4025
+%patch29 -p0 -b .rh598255
+%patch30 -p0 -b .rh624866
 
 cp -r /usr/share/xorg-x11-server-source/* unix/xserver
 pushd unix/xserver
@@ -269,6 +273,11 @@ fi
 %endif
 
 %changelog
+* Wed Aug 18 2010 Adam Tkac <atkac redhat com> 1.0.1-2
+- vncviewer: don't crash during pixel format change (#598255)
+- vncviewer: don't call setColourMapEntries when pixel format has been changed
+  (#624866)
+
 * Wed Apr 14 2010 Adam Tkac <atkac redhat com> 1.0.1-1
 - update to 1.0.1 bugfix release
 - patches merged
diff --git a/tigervnc10-rh598255.patch b/tigervnc10-rh598255.patch
new file mode 100644
index 0000000..717504a
--- /dev/null
+++ b/tigervnc10-rh598255.patch
@@ -0,0 +1,80 @@
+Index: unix/vncviewer/CConn.cxx
+===================================================================
+--- unix/vncviewer/CConn.cxx	(revision 4003)
++++ unix/vncviewer/CConn.cxx	(revision 4004)
+@@ -33,6 +33,7 @@
+ #include <rfb/Password.h>
+ #include <rfb/screenTypes.h>
+ #include <network/TcpSocket.h>
++#include <cassert>
+ 
+ #include "TXViewport.h"
+ #include "DesktopWindow.h"
+@@ -62,7 +63,7 @@
+     encodingChange(false), sameMachine(false), fullScreen(::fullScreen),
+     ctrlDown(false), altDown(false),
+     menuKeysym(0), menu(dpy, this), options(dpy, this), about(dpy), info(dpy),
+-    reverseConnection(reverse), firstUpdate(true)
++    reverseConnection(reverse), firstUpdate(true), pendingUpdate(false)
+ {
+   CharArray menuKeyStr(menuKey.getData());
+   menuKeysym = XStringToKeysym(menuKeyStr.buf);
+@@ -306,8 +307,11 @@
+ // one. We cannot do this if we're in the middle of a format change
+ // though.
+ void CConn::framebufferUpdateStart() {
+-  if (!formatChange)
++  if (!formatChange) {
++    pendingUpdate = true;
+     requestNewUpdate();
++  } else
++    pendingUpdate = false;
+ }
+ 
+ // framebufferUpdateEnd() is called at the end of an update.
+@@ -367,7 +371,7 @@
+ 
+   // A format change prevented us from sending this before the update,
+   // so make sure to send it now.
+-  if (formatChange)
++  if (formatChange && !pendingUpdate)
+     requestNewUpdate();
+ 
+   // Compute new settings based on updated bandwidth values
+@@ -536,8 +540,11 @@
+     break;
+   case ID_REFRESH:
+     menu.unmap();
+-    writer()->writeFramebufferUpdateRequest(Rect(0, 0, cp.width, cp.height),
+-                                            false);
++    if (!formatChange) {
++      writer()->writeFramebufferUpdateRequest(Rect(0, 0, cp.width, cp.height),
++                                              false);
++      pendingUpdate = true;
++    }
+     break;
+   case ID_F8:
+     menu.unmap();
+@@ -840,6 +847,10 @@
+ void CConn::requestNewUpdate()
+ {
+   if (formatChange) {
++
++    /* Catch incorrect requestNewUpdate calls */
++    assert(pendingUpdate == false);
++
+     if (fullColour) {
+       desktop->setPF(fullColourPF);
+     } else {
+Index: unix/vncviewer/CConn.h
+===================================================================
+--- unix/vncviewer/CConn.h	(revision 4003)
++++ unix/vncviewer/CConn.h	(revision 4004)
+@@ -132,6 +132,7 @@
+   InfoDialog info;
+   bool reverseConnection;
+   bool firstUpdate;
++  bool pendingUpdate;
+ };
+ 
+ #endif
diff --git a/tigervnc10-rh624866.patch b/tigervnc10-rh624866.patch
new file mode 100644
index 0000000..8b5d67f
--- /dev/null
+++ b/tigervnc10-rh624866.patch
@@ -0,0 +1,14 @@
+Index: unix/tx/TXImage.cxx
+===================================================================
+--- unix/tx/TXImage.cxx	(revision 4002)
++++ unix/tx/TXImage.cxx	(revision 4003)
+@@ -164,7 +164,8 @@
+ 
+ void TXImage::updateColourMap()
+ {
+-  tig->setColourMapEntries(0, 0, 0);
++  if (tig != 0)
++    tig->setColourMapEntries(0, 0, 0);
+ }
+ 
+ void TXImage::lookup(int index, int* r, int* g, int* b)


More information about the scm-commits mailing list