Skip to content

Commit 098e579

Browse files
intorrXottab-DUTY
authored andcommitted
To avoid vector end iterator dereference (this is undefined behaviour).
1 parent 0c24325 commit 098e579

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Layers/xrRender/PSLibrary.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ void CPSLibrary::Reload()
273273

274274
using PS::CPGDef;
275275

276-
CPGDef const* const* CPSLibrary::particles_group_begin() const { return (m_PGDs.size() ? &*m_PGDs.begin() : 0); }
277-
CPGDef const* const* CPSLibrary::particles_group_end() const { return (m_PGDs.size() ? &*m_PGDs.end() : 0); }
276+
CPGDef const* const* CPSLibrary::particles_group_begin() const { return (m_PGDs.size() ? &m_PGDs.front() : 0); }
277+
CPGDef const* const* CPSLibrary::particles_group_end() const { return (m_PGDs.size() ? &m_PGDs.back() : 0); }
278278
void CPSLibrary::particles_group_next(PS::CPGDef const* const*& iterator) const
279279
{
280280
VERIFY(iterator);

0 commit comments

Comments
 (0)