[ultimatestunts/f13/master] fix crash in replay (#652855)

Dan Horák sharkcz at fedoraproject.org
Sat Apr 16 14:36:14 UTC 2011


commit ff74a28af63d9b678e32e18151e07e9dbd735ea7
Author: Dan Horák <dan at danny.cz>
Date:   Sat Apr 16 16:35:29 2011 +0200

    fix crash in replay (#652855)
    
    Conflicts:
    
    	ultimatestunts.spec

 ultimatestunts-0751-replay.patch |   13 +++++++++++++
 ultimatestunts.spec              |    7 ++++++-
 2 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/ultimatestunts-0751-replay.patch b/ultimatestunts-0751-replay.patch
new file mode 100644
index 0000000..4bc113f
--- /dev/null
+++ b/ultimatestunts-0751-replay.patch
@@ -0,0 +1,13 @@
+diff -up ultimatestunts-srcdata-0751/simulation/replayer.cpp.orig ultimatestunts-srcdata-0751/simulation/replayer.cpp
+--- ultimatestunts-srcdata-0751/simulation/replayer.cpp.orig	2011-04-16 14:55:32.000000000 +0200
++++ ultimatestunts-srcdata-0751/simulation/replayer.cpp	2011-04-16 14:56:58.000000000 +0200
+@@ -203,6 +203,9 @@ bool CReplayer::readData()
+ 	{
+ 		unsigned int pos = 0;
+ 		CBinBuffer header = readBytes(2); //16 bits
++		if(header.size() < 2) //reached end of file
++                        return false;
++
+ 		unsigned int dataSize = header.getUint16(pos);
+ 
+ 		CBinBuffer data = readBytes(dataSize);
diff --git a/ultimatestunts.spec b/ultimatestunts.spec
index 2496cd9..84d956c 100644
--- a/ultimatestunts.spec
+++ b/ultimatestunts.spec
@@ -2,7 +2,7 @@
 
 Name:		ultimatestunts
 Version:	0.7.5
-Release:	5%{?dist}
+Release:	6%{?dist}
 Summary:	Remake of the famous DOS-game Stunts
 
 Group:		Amusements/Games
@@ -12,6 +12,7 @@ Source0:	http://downloads.sf.net/%{name}/%{name}-srcdata-%{ver}.tar.gz
 Source1:	%{name}.desktop
 Patch0:		ultimatestunts-0721-make.patch
 Patch1:		ultimatestunts-0751-locale.patch
+Patch2:		ultimatestunts-0751-replay.patch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:	dos2unix freealut-devel SDL_image-devel freeglut-devel libXi-devel
@@ -33,6 +34,7 @@ graphics, 3D sound and internet multiplaying.
 %setup -q -n %{name}-srcdata-%{ver}
 %patch0
 %patch1
+%patch2 -p1
 
 # remove CVS control files
 find . -name CVS -type d -print0 | xargs -0 rm -rf
@@ -101,6 +103,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Sat Apr 16 2011 Dan Horák <dan[at]danny.cz> 0.7.5-6
+- fix crash in replay (#652855)
+
 * Mon Aug 17 2009 Dan Horák <dan[at]danny.cz> 0.7.5-5
 - rebuild with openal-soft
 


More information about the scm-commits mailing list