rpms/duel3/devel Duel3_20060225-fix-buf-oflow.patch, NONE, 1.1 Duel3_20060225-windowed-mode.patch, NONE, 1.1 duel3.spec, 1.5, 1.6

Hans de Goede jwrdegoede at fedoraproject.org
Wed Dec 3 16:09:40 UTC 2008


Author: jwrdegoede

Update of /cvs/extras/rpms/duel3/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26367

Modified Files:
	duel3.spec 
Added Files:
	Duel3_20060225-fix-buf-oflow.patch 
	Duel3_20060225-windowed-mode.patch 
Log Message:
* Wed Dec  3 2008 Hans de Goede <hdegoede at redhat.com> 0.1-0.6.20060225
- Fix a buffer overflow crash (bz 473374)


Duel3_20060225-fix-buf-oflow.patch:

--- NEW FILE Duel3_20060225-fix-buf-oflow.patch ---
diff -up Duel3_20060225_src/Source/Player.cpp~ Duel3_20060225_src/Source/Player.cpp
--- Duel3_20060225_src/Source/Player.cpp~	2008-12-03 16:46:42.000000000 +0100
+++ Duel3_20060225_src/Source/Player.cpp	2008-12-03 16:46:42.000000000 +0100
@@ -111,7 +111,7 @@ void Player::drawHotSeatHUD(int playerNu
     //if(blue_bar.retExist()==false)
     //    blue_bar.setPict(161,10,"w_hud/blue_bar.bmp");
 
-    char ammo_left[4], shield_percent[5], armour_percent[5], lives_left[4];
+    char ammo_left[5], shield_percent[5], armour_percent[5], lives_left[4];
     int xPos,yPos;
     
     if(ship.retWepHoming()==true)   //only display the tageting reticle if a weapon with homing is selected

Duel3_20060225-windowed-mode.patch:

--- NEW FILE Duel3_20060225-windowed-mode.patch ---
diff -up Duel3_20060225_src/Source/main.cpp~ Duel3_20060225_src/Source/main.cpp
--- Duel3_20060225_src/Source/main.cpp~	2008-12-03 16:58:58.000000000 +0100
+++ Duel3_20060225_src/Source/main.cpp	2008-12-03 16:56:14.000000000 +0100
@@ -119,6 +119,7 @@ volatile int sec=0;
 int iGraphicsLoops=0;
 int iLogicLoops=0;
 bool bQuitGame=false;
+bool bFullScreen=true;
 #ifdef __unix__
 int check_and_create_dir(const char* dir);
 char *homedir;
@@ -240,6 +241,13 @@ int cur_song_num=rand()%3;
 
 int main(int argc, const char **argv) 
 {    
+    if (argc == 2 && !strcmp(argv[1], "-w"))
+        bFullScreen = false;
+    else if (argc != 1) {
+        printf("Usage: duel3 [-w]\nPass -w to run in windowed mode\n");
+        return 1;
+    }
+
 #ifdef __unix__
     homedir = getenv("HOME");
     homedir = homedir?homedir:(char *)".";
@@ -796,6 +804,8 @@ void loadShipDefs(char *filename)
 
 int initAllegroGL(void)
 {
+    int res;
+
     outtext(LOGFILE,"INIT ALLEGROGL\n");
     allegro_init();
 	install_allegro_gl();
@@ -806,7 +816,10 @@ int initAllegroGL(void)
     allegro_gl_clear_settings();
 	allegro_gl_set (AGL_COLOR_DEPTH, 32);
 	allegro_gl_set (AGL_Z_DEPTH, 16);
-	allegro_gl_set (AGL_FULLSCREEN, TRUE);
+	if (bFullScreen)
+	    allegro_gl_set (AGL_FULLSCREEN, TRUE);
+        else
+	    allegro_gl_set (AGL_FULLSCREEN, FALSE);
 	allegro_gl_set (AGL_DOUBLEBUFFER, 1);
 	allegro_gl_set (AGL_RENDERMETHOD, 1);
 	allegro_gl_set (AGL_SUGGEST, AGL_COLOR_DEPTH | AGL_Z_DEPTH | AGL_DOUBLEBUFFER
@@ -815,7 +828,12 @@ int initAllegroGL(void)
 
     outtext(LOGFILE,"Setting gfx mode\n");
 	set_color_depth (32);
-	if (set_gfx_mode(GFX_OPENGL_FULLSCREEN/*WINDOWED*//*FULLSCREEN*/, 800, 600, 0, 0) < 0) {
+	if (bFullScreen)
+	    res = set_gfx_mode(GFX_OPENGL_FULLSCREEN, 800, 600, 0, 0);
+        else
+	    res = set_gfx_mode(GFX_OPENGL_WINDOWED, 800, 600, 0, 0);
+
+	if (res < 0) {
         outtext(LOGFILE,"!!Error setting gfx mode!!\n");
 		allegro_message ("Error setting graphics mode:\n%s\n", allegro_error);
 		return -1;


Index: duel3.spec
===================================================================
RCS file: /cvs/extras/rpms/duel3/devel/duel3.spec,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- duel3.spec	19 Feb 2008 08:17:03 -0000	1.5
+++ duel3.spec	3 Dec 2008 16:09:09 -0000	1.6
@@ -1,7 +1,7 @@
 %define snapshot 20060225
 Name:           duel3
 Version:        0.1
-Release:        0.5.%{snapshot}%{?dist}
+Release:        0.6.%{snapshot}%{?dist}
 Summary:        One on one spaceship duel in a 2D arena
 Group:          Amusements/Games
 License:        BSD
@@ -12,6 +12,8 @@
 Source3:        %{name}.png
 Source4:        music-credits.txt
 Patch0:         Duel3_20060225-fixes.patch
+Patch1:         Duel3_20060225-windowed-mode.patch
+Patch2:         Duel3_20060225-fix-buf-oflow.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  alleggl-devel dumb-devel libGLU-devel desktop-file-utils
 Requires:       hicolor-icon-theme opengl-games-utils
@@ -41,7 +43,9 @@
 %setup -q -a 1 -n Duel3_%{snapshot}_src
 mv Duel3_%{snapshot}_bin/* Source
 cp %{SOURCE4} .
-%patch0 -p1 -z .fixes
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
 sed -i 's/\r//' Source/readme.txt license.txt music-credits.txt
 
 
@@ -96,6 +100,9 @@
 
 
 %changelog
+* Wed Dec  3 2008 Hans de Goede <hdegoede at redhat.com> 0.1-0.6.20060225
+- Fix a buffer overflow crash (bz 473374)
+
 * Tue Feb 19 2008 Fedora Release Engineering <rel-eng at fedoraproject.org> - 0.1-0.5.20060225
 - Autorebuild for GCC 4.3
 




More information about the fedora-extras-commits mailing list