mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 14:52:01 +00:00
Rides Again: Possible array index by -1 in Proj_DoHitscan(). Added check to prevent this.
This commit is contained in:
parent
2217dcb632
commit
e4fb67bc25
1 changed files with 2 additions and 2 deletions
|
@ -111,7 +111,7 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa,
|
|||
bsin(sa), zvel << 6,
|
||||
&hitsect, &hitwall, &hitsprt, &hitx, &hity, &hitz, CLIPMASK1);
|
||||
|
||||
if (isRRRA() && ((sector[hitsect].lotag == 160 && zvel > 0) || (sector[hitsect].lotag == 161 && zvel < 0))
|
||||
if (isRRRA() && hitsect >= 0 && ((sector[hitsect].lotag == 160 && zvel > 0) || (sector[hitsect].lotag == 161 && zvel < 0))
|
||||
&& hitsprt == nullptr && hitwall == -1)
|
||||
{
|
||||
DukeLinearSpriteIterator its;
|
||||
|
@ -268,7 +268,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
|
|||
hitscan(sx, sy, sz, sect, bcos(sa), bsin(sa),
|
||||
zvel << 6, &hitsect, &hitwall, &hitsprt, &hitx, &hity, &hitz, CLIPMASK1);
|
||||
|
||||
if (isRRRA() && (((sector[hitsect].lotag == 160 && zvel > 0) || (sector[hitsect].lotag == 161 && zvel < 0))
|
||||
if (isRRRA() && hitsect >= 0 && (((sector[hitsect].lotag == 160 && zvel > 0) || (sector[hitsect].lotag == 161 && zvel < 0))
|
||||
&& hitsprt == nullptr && hitwall == -1))
|
||||
{
|
||||
DukeLinearSpriteIterator its;
|
||||
|
|
Loading…
Reference in a new issue