Bug#338834: [PATCH] fix for initial crash

Kees Cook kees at outflux.net
Tue Sep 26 01:05:31 UTC 2006


Attached patch fixes the initial load crashing (typo in the code used 
the wrong file pointer).

-- 
Kees Cook                                            @outflux.net
-------------- next part --------------
--- abuse-sdl-0.7.0/src/light.cpp.orig	2006-09-25 17:46:16.134072762 -0700
+++ abuse-sdl-0.7.0/src/light.cpp	2006-09-25 17:48:20.081482467 -0700
@@ -210,7 +210,6 @@ void calc_light_table(palette *pal)
 	if( fp->open_failure() )
 	{
 		recalc = 1;
-		delete fp;
 	}
 	else
 	{
@@ -226,8 +225,9 @@ void calc_light_table(palette *pal)
 //			trans_table=(uint8_t *)jmalloc(256*256,"transparency table");
 //			fp.read(trans_table,256*256);
 		}
-		delete fp;
 	}
+	delete fp;
+	fp = NULL;
 
 	if( recalc )
 	{
@@ -348,7 +348,7 @@ void calc_light_table(palette *pal)
 //      f->write(green_light,256*64);
 			for (int i=0;i<TTINTS;i++)
 				f->write(tints[i],256);
-			fp->write(bright_tint,256);
+			f->write(bright_tint,256);
 //    f.write(trans_table,256*256);
 		}
 		delete f;


More information about the Pkg-games-devel mailing list