Skip to content

Commit

Permalink
Fixed segfault in sight checking (outside the valid area?)
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Aug 7, 2004
1 parent ad61dae commit a4df4ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doomsday/Src/p_intercept.c
Expand Up @@ -117,8 +117,7 @@ boolean P_TraverseIntercepts(traverser_t func, fixed_t maxfrac)
}

/*
* P_SightTraverseIntercepts
* Returns true if the traverser function returns true for all lines.
* Returns true if the traverser function returns true for all lines.
*/
boolean P_SightTraverseIntercepts(divline_t * strace,
boolean (*func) (intercept_t *))
Expand Down Expand Up @@ -148,6 +147,7 @@ boolean P_SightTraverseIntercepts(divline_t * strace,
dist = scan->frac;
in = scan;
}
if(!in) continue; // huh?

if(!func(in))
return false; // don't bother going farther
Expand Down
2 changes: 2 additions & 0 deletions doomsday/Src/p_sight.c
Expand Up @@ -65,6 +65,8 @@ boolean PTR_SightTraverse(intercept_t * in)
line_t *li;
fixed_t slope;

if(in == NULL) return true; // Something was out of bounds?

li = in->d.line;

// Crosses a two sided line.
Expand Down

0 comments on commit a4df4ac

Please sign in to comment.