[glaxium] Fix crash on 64 bit machines

Hans de Goede jwrdegoede at fedoraproject.org
Thu Jun 16 14:26:02 UTC 2011


commit 4fe2ab187f7c7c70612d0d6ce594e3bf012e63c2
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Thu Jun 16 16:26:25 2011 +0200

    Fix crash on 64 bit machines

 glaxium.spec                  |    7 ++++++-
 glaxium_0.5-64bit-crash.patch |   20 ++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/glaxium.spec b/glaxium.spec
index daba000..9c5a9c1 100644
--- a/glaxium.spec
+++ b/glaxium.spec
@@ -1,6 +1,6 @@
 Name:           glaxium
 Version:        0.5
-Release:        9%{?dist}
+Release:        10%{?dist}
 Summary:        An OpenGL space shooter
 Group:          Amusements/Games
 License:        GPLv2+
@@ -12,6 +12,7 @@ Patch0:         %{name}-0.5-fixes.patch
 Patch1:         %{name}_0.5-allow-running-when-dsp-busy.patch
 Patch2:         %{name}_0.5-glutInit.patch
 Patch3:         %{name}_0.5-rh553067.patch
+Patch4:         %{name}_0.5-64bit-crash.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  SDL_mixer-devel freeglut-devel libpng-devel desktop-file-utils
 Requires:       hicolor-icon-theme opengl-games-utils
@@ -27,6 +28,7 @@ of that type, but with 3D for the special effects.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 sed -i 's|/games/glaxium|/glaxium|g' configure* Makefile.in
 sed -i 's/\r//g' CHANGES.txt LICENSE README.txt
 
@@ -81,6 +83,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 
 
 %changelog
+* Thu Jun 16 2011 Hans de Goede <hdegoede at redhat.com> 0.5-10
+- Fix crash on 64 bit machines
+
 * Tue Feb 08 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.5-9
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 
diff --git a/glaxium_0.5-64bit-crash.patch b/glaxium_0.5-64bit-crash.patch
new file mode 100644
index 0000000..5af7bcc
--- /dev/null
+++ b/glaxium_0.5-64bit-crash.patch
@@ -0,0 +1,20 @@
+Hans de Goede:
+
+Without this patch glaxium crashes in F-15 on 64 bit machines,
+I must admit I'm not quite sure why. But the code is cleaner with this
+patch and the crash is gone, so ...
+
+diff -up glaxium_0.5/scene.cpp~ glaxium_0.5/scene.cpp
+--- glaxium_0.5/scene.cpp~	2002-10-10 14:57:58.000000000 +0200
++++ glaxium_0.5/scene.cpp	2011-06-16 16:22:15.580174520 +0200
+@@ -332,9 +332,7 @@ void Scene::drawSky()
+ 
+ 
+ float* getDirection(float x, float y, float z) {
+-  static float *fReturn = NULL;
+-
+-  if (fReturn==NULL) fReturn = new float[3];
++  static float fReturn[3];
+ 
+   float py = 2;
+   float px, pz;


More information about the scm-commits mailing list