[blender] Fix crash in libspnav (#814665)

Jochen Schmitt s4504kr at fedoraproject.org
Wed Apr 25 15:55:11 UTC 2012


commit 96b2edbb8361dcdb1cc81d26cd8c17634c6ed378
Author: Jochen Schmitt <Jochen at herr-schmitt.de>
Date:   Wed Apr 25 17:55:01 2012 +0200

    Fix crash in libspnav (#814665)

 blender-2.62-ndof.patch |   52 +++++++++++++++++++++++++++++++++++++++++++++++
 blender.spec            |   10 ++++++++-
 2 files changed, 61 insertions(+), 1 deletions(-)
---
diff --git a/blender-2.62-ndof.patch b/blender-2.62-ndof.patch
new file mode 100644
index 0000000..ae643d9
--- /dev/null
+++ b/blender-2.62-ndof.patch
@@ -0,0 +1,52 @@
+--- intern/ghost/intern/GHOST_NDOFManagerX11.cpp	(revision 45950)
++++ intern/ghost/intern/GHOST_NDOFManagerX11.cpp	(revision 45951)
+@@ -75,28 +75,32 @@ 
+ 
+ bool GHOST_NDOFManagerX11::processEvents()
+ {
+-	GHOST_TUns64 now = m_system.getMilliSeconds();
+-
+ 	bool anyProcessed = false;
+-	spnav_event e;
+-	while (spnav_poll_event(&e)) {
+-		switch (e.type) {
+-			case SPNAV_EVENT_MOTION:
+-			{
+-				/* convert to blender view coords */
+-				short t[3] = {e.motion.x, e.motion.y, -e.motion.z};
+-				short r[3] = {-e.motion.rx, -e.motion.ry, e.motion.rz};
+ 
+-				updateTranslation(t, now);
+-				updateRotation(r, now);
+-				break;
++	if (m_available) {
++		GHOST_TUns64 now = m_system.getMilliSeconds();
++
++		spnav_event e;
++		while (spnav_poll_event(&e)) {
++			switch (e.type) {
++				case SPNAV_EVENT_MOTION:
++				{
++					/* convert to blender view coords */
++					short t[3] = {e.motion.x, e.motion.y, -e.motion.z};
++					short r[3] = {-e.motion.rx, -e.motion.ry, e.motion.rz};
++
++					updateTranslation(t, now);
++					updateRotation(r, now);
++					break;
++				}
++				case SPNAV_EVENT_BUTTON:
++					updateButton(e.button.bnum, e.button.press, now);
++					break;
+ 			}
+-			case SPNAV_EVENT_BUTTON:
+-				updateButton(e.button.bnum, e.button.press, now);
+-				break;
++			anyProcessed = true;
+ 		}
+-		anyProcessed = true;
+ 	}
++
+ 	return anyProcessed;
+ }
+ 
diff --git a/blender.spec b/blender.spec
index bfb0410..b53039f 100644
--- a/blender.spec
+++ b/blender.spec
@@ -12,7 +12,7 @@
 Name:           blender
 Epoch:		1
 Version:        2.62
-Release: 	5%{?dist}
+Release: 	6%{?dist}
 
 Summary:        3D modeling, animation, rendering and post-production
 
@@ -35,6 +35,9 @@ Patch5:		blender-2.50-uninit-var.patch
 Patch10:	blender-2.58-python_include.patch
 Patch11: 	blender-2.61-openjpeg_stdbool.patch
 
+# Upstream Patch, Should fixed in 2.63
+Patch101:       blender-2.62-ndof.patch
+
 BuildRequires:  desktop-file-utils
 BuildRequires:  gettext
 BuildRequires:  libtool
@@ -147,6 +150,8 @@ addon packages to extend blender.
 %patch10 -p1
 %patch11 -p1 -b .openjpeg_stdbool
 
+%patch101 -p0 -b .ndof
+
 find -name '.svn' -print | xargs rm -rf
 
 %build
@@ -291,6 +296,9 @@ fi || :
 %{_sysconfdir}/rpm/macros.blender
 
 %changelog
+* Wed Apr 25 2012 Jochen Schmitt <Jochen herr-schmitt de> 1:2.62-6
+- Fix crash in libspnav (#814665)
+
 * Tue Apr 24 2012 Jochen Schmitt <Jochen herr-schmitt de> 1:2.62-5
 - Add cycles support (#812354)
 


More information about the scm-commits mailing list