Skip to content

Commit

Permalink
Fix an out-of-bounds bug in ObjectIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaldron committed Dec 5, 2023
1 parent cabeb05 commit e7169eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/osgEarth/ObjectIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,16 @@ ObjectIndex::tagRange(osg::Drawable* drawable, ObjectID id, unsigned int start,
ids->setPreserveDataType(true);
}

if (ids->size() < start + count)
{
ids->resize(start + count);
}

for (unsigned int i = 0; i < count; ++i)
{
(*ids)[start + i] = id;
}

ids->dirty();
}

Expand Down

0 comments on commit e7169eb

Please sign in to comment.