Skip to content

Commit

Permalink
Fixed: SIGSEGV when attempting to create states from incomplete defin…
Browse files Browse the repository at this point in the history
…itions or which reference unknown sprite frames.
  • Loading branch information
danij committed Jun 3, 2009
1 parent 5562747 commit 1c7ea50
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions doomsday/engine/portable/src/def_main.c
Expand Up @@ -887,12 +887,16 @@ void Def_Read(void)

for(i = 0; i < countStates.num; ++i)
{
ded_state_t* dst = &defs.states[i];
ded_state_t* dstNew, *dst = &defs.states[i];
// Make sure duplicate IDs overwrite the earliest.
int stateNum = Def_GetStateNum(dst->id);
ded_state_t* dstNew = defs.states + stateNum;
state_t* st = states + stateNum;
state_t* st;

if(stateNum == -1)
continue;

dstNew = defs.states + stateNum;
st = states + stateNum;
st->sprite = Def_GetSpriteNum(dst->sprite.id);
st->flags = dst->flags;
st->frame = dst->frame;
Expand Down

0 comments on commit 1c7ea50

Please sign in to comment.