SVN r65 (trunk)

This commit is contained in:
Christoph Oelckers 2006-04-23 09:02:19 +00:00
parent 1e1db5dd0c
commit b229d07500
6 changed files with 17 additions and 7 deletions

View File

@ -1,3 +1,10 @@
April 22, 2006 (Changes by Graf Zahl)
- Fixed: V_InitCustomFonts initialized lastlump to -1 instead of 0.
- Fixed: CreateTexture never checked whether it could read from the
texture lump. Since the minimum valid length is 13 bytes for a
1x1 pixel patch everything below that will now return with an error.
- Fixed a few occurences of mismatched free's for new'd memory.
April 21, 2006 (Changes by Graf Zahl) April 21, 2006 (Changes by Graf Zahl)
- Fixed: To prevent the pointer cleanup code from crashing numsectors has - Fixed: To prevent the pointer cleanup code from crashing numsectors has
to be set to 0 when the sectors array is deleted. to be set to 0 when the sectors array is deleted.

View File

@ -294,8 +294,8 @@ static void ParseLock()
} }
} }
// copy the messages if the other one does not exist // copy the messages if the other one does not exist
if (!lock->remotemsg && lock->message) lock->remotemsg=strdup(lock->message); if (!lock->remotemsg && lock->message) lock->remotemsg = copystring(lock->message);
if (!lock->message && lock->remotemsg) lock->message=strdup(lock->remotemsg); if (!lock->message && lock->remotemsg) lock->message = copystring(lock->remotemsg);
lock->keylist.ShrinkToFit(); lock->keylist.ShrinkToFit();
} }

View File

@ -292,7 +292,7 @@ void P_ProcessSwitchDef ()
{ {
free (def1); free (def1);
} }
free (picname); delete [] picname;
return; return;
} }
@ -316,7 +316,7 @@ void P_ProcessSwitchDef ()
def2->PairIndex = AddSwitchDef (def1); def2->PairIndex = AddSwitchDef (def1);
def1->PairIndex = AddSwitchDef (def2); def1->PairIndex = AddSwitchDef (def2);
def1->QuestPanel = def2->QuestPanel = quest; def1->QuestPanel = def2->QuestPanel = quest;
free (picname); delete [] picname;
} }
FSwitchDef *ParseSwitchDef (bool ignoreBad) FSwitchDef *ParseSwitchDef (bool ignoreBad)

View File

@ -234,9 +234,11 @@ int FTextureManager::CreateTexture (int lumpnum, int usetype)
{ {
FTexture *out = NULL; FTexture *out = NULL;
enum { t_patch, t_raw, t_imgz, t_png } type = t_patch; enum { t_patch, t_raw, t_imgz, t_png } type = t_patch;
DWORD first4bytes; DWORD first4bytes=0;
if (lumpnum < 0) // Must check the length of the lump. Zero length flat markers (F1_START etc.) will come through here.
// 13 is the minimum length of andthing valid (i.e a 1x1 pixel Doom patch.)
if (lumpnum < 0 || Wads.LumpLength(lumpnum)<13)
{ {
return -1; return -1;
} }

View File

@ -277,6 +277,7 @@ SDLFB::SDLFB (int width, int height, bool fullscreen)
NeedGammaUpdate = false; NeedGammaUpdate = false;
UpdatePending = false; UpdatePending = false;
NotPaletted = false; NotPaletted = false;
FlashAmount = 0;
Screen = SDL_SetVideoMode (width, height, vid_displaybits, Screen = SDL_SetVideoMode (width, height, vid_displaybits,
SDL_HWSURFACE|SDL_HWPALETTE|SDL_DOUBLEBUF|SDL_ANYFORMAT| SDL_HWSURFACE|SDL_HWPALETTE|SDL_DOUBLEBUF|SDL_ANYFORMAT|

View File

@ -1233,7 +1233,7 @@ void V_InitCustomFonts()
char namebuffer[16], templatebuf[16]; char namebuffer[16], templatebuf[16];
int adder=0; int adder=0;
int i; int i;
int llump,lastlump=-1; int llump,lastlump=0;
int format; int format;
int start; int start;
int first; int first;