Skip to content

Commit

Permalink
To avoid vector end iterator dereference (this is undefined behaviour).
Browse files Browse the repository at this point in the history
  • Loading branch information
intorr authored and Xottab-DUTY committed Dec 12, 2017
1 parent 0c24325 commit 098e579
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Layers/xrRender/PSLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ void CPSLibrary::Reload()

using PS::CPGDef;

CPGDef const* const* CPSLibrary::particles_group_begin() const { return (m_PGDs.size() ? &*m_PGDs.begin() : 0); }
CPGDef const* const* CPSLibrary::particles_group_end() const { return (m_PGDs.size() ? &*m_PGDs.end() : 0); }
CPGDef const* const* CPSLibrary::particles_group_begin() const { return (m_PGDs.size() ? &m_PGDs.front() : 0); }
CPGDef const* const* CPSLibrary::particles_group_end() const { return (m_PGDs.size() ? &m_PGDs.back() : 0); }
void CPSLibrary::particles_group_next(PS::CPGDef const* const*& iterator) const
{
VERIFY(iterator);
Expand Down

0 comments on commit 098e579

Please sign in to comment.