Skip to content

Commit

Permalink
Merge pull request #947 from bponsler/billboardline-fix
Browse files Browse the repository at this point in the history
Fix for chainIndex out of bounds in BillboardChain::addChainElement
  • Loading branch information
wjwwood committed Feb 26, 2016
2 parents a27b24a + a479af3 commit bbfb0c5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/rviz/ogre_helpers/billboard_line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,15 @@ void BillboardLine::setupChains()
if (it + 1 == end)
{
uint32_t lines_left = num_lines_ % lines_per_chain_;
(*it)->setNumberOfChains(lines_left);

// Handle the case where num_lines_ is a multiple of lines_per_chain
if (lines_left == 0) {
(*it)->setNumberOfChains(lines_per_chain_);
}
else
{
(*it)->setNumberOfChains(lines_left);
}
}
else
{
Expand Down Expand Up @@ -287,5 +295,3 @@ const Ogre::Quaternion& BillboardLine::getOrientation()
}

} // namespace rviz


0 comments on commit bbfb0c5

Please sign in to comment.