Skip to content

Array Bug since the idSoftware base? #130

@elbriga

Description

@elbriga

On the file Quake/r_world.c line 130 the "leafs" array is accessed with a "i+1" index, so in the last iteration it will access "leafs[numleafs]", which is out of the array, isn't it?

On other similar parts of the code there is also this access.

I've tracked this behavior all the way on Fitzquake and on Id's source too.

r_world.c:130:

        // iterate through leaves, marking surfaces
	leaf = &cl.worldmodel->leafs[1];
	for (i=0 ; i<cl.worldmodel->numleafs ; i++, leaf++)
	{
		if (vis[i>>3] & (1<<(i&7)))
		{

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions