- Fixed: Trying to play a 0-length song from a wad inside a zip caused a crash.

SVN r181 (trunk)
This commit is contained in:
Randy Heit 2006-06-09 00:26:07 +00:00
parent 0c62f08a58
commit c808041337
7 changed files with 19 additions and 8 deletions

View file

@ -1,3 +1,6 @@
June 8, 2006
- Fixed: Trying to play a 0-length song from a wad inside a zip caused a crash.
June 7, 2006 (Changes by Graf Zahl)
- Fixed: A_CustomPunch didn't use the range parameter correctly.

View file

@ -748,7 +748,6 @@ void FNodeBuilder::SplitSegs (DWORD set, node_t &node, DWORD splitseg, DWORD &ou
FPrivVert newvert;
unsigned int vertnum;
int seg2;
unsigned int i;
if (seg->loopnum)
{

View file

@ -102,8 +102,8 @@ void FNodeBuilder::FindUsedVertices (vertex_t *oldverts, int max)
map[v2] = VertexMap->SelectVertexExact (newvert);
}
Level.Lines[i].v1 = (vertex_t *)map[v1];
Level.Lines[i].v2 = (vertex_t *)map[v2];
Level.Lines[i].v1 = (vertex_t *)(size_t)map[v1];
Level.Lines[i].v2 = (vertex_t *)(size_t)map[v2];
}
}

View file

@ -1148,8 +1148,10 @@ void R_DrawSkyBoxes ()
FirstInterestingDrawseg = InterestingDrawsegs.Size();
interestingStack.Push (FirstInterestingDrawseg);
drawsegStack.Push (firstdrawseg - drawsegs);
visspriteStack.Push (firstvissprite - vissprites);
ptrdiff_t diffnum = firstdrawseg - drawsegs;
drawsegStack.Push (diffnum);
diffnum = firstvissprite - vissprites;
visspriteStack.Push (diffnum);
viewxStack.Push (viewx);
viewyStack.Push (viewy);
viewzStack.Push (viewz);

View file

@ -1539,7 +1539,8 @@ void R_StoreWallRange (int start, int stop)
if (rw_markmirror)
{
WallMirrors.Push (ds_p - drawsegs);
size_t drawsegnum = ds_p - drawsegs;
WallMirrors.Push (drawsegnum);
ds_p->silhouette = SIL_BOTH;
}
else if (backsector == NULL)
@ -1647,7 +1648,8 @@ void R_StoreWallRange (int start, int stop)
if (ds_p->bFogBoundary || ds_p->maskedtexturecol != -1)
{
InterestingDrawsegs.Push (ds_p - drawsegs);
size_t drawsegnum = ds_p - drawsegs;
InterestingDrawsegs.Push (drawsegnum);
}
}
}

View file

@ -1520,6 +1520,11 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
offset = -1; // this tells the low level code that the music
// is being used from memory
length = Wads.LumpLength (lumpnum);
if (length == 0)
{
offset = 0;
return false;
}
musiccache.Resize(length);
Wads.ReadLump(lumpnum, &musiccache[0]);
}