mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-14 11:50:49 +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,
|
bsin(sa), zvel << 6,
|
||||||
&hitsect, &hitwall, &hitsprt, &hitx, &hity, &hitz, CLIPMASK1);
|
&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)
|
&& hitsprt == nullptr && hitwall == -1)
|
||||||
{
|
{
|
||||||
DukeLinearSpriteIterator its;
|
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),
|
hitscan(sx, sy, sz, sect, bcos(sa), bsin(sa),
|
||||||
zvel << 6, &hitsect, &hitwall, &hitsprt, &hitx, &hity, &hitz, CLIPMASK1);
|
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))
|
&& hitsprt == nullptr && hitwall == -1))
|
||||||
{
|
{
|
||||||
DukeLinearSpriteIterator its;
|
DukeLinearSpriteIterator its;
|
||||||
|
|
Loading…
Reference in a new issue