aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/particles
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2011-07-05 15:16:55 +1000
committerQt by Nokia <qt-info@nokia.com>2011-07-07 10:00:54 +0200
commit8f2c875d37ebb880720f66be6709e4e5852d9aad (patch)
tree86cfc612e91c659efc6e659757beb0fed8a393f9 /src/declarative/particles
parentdf781be6e5ca1fef658f8b7c6592ea02711d1a1e (diff)
Fix possible index out of bounds exception
The sprite engine count needs to grow to the same size as the system index count, as the indexes are synchronized. Change-Id: I299816bfe6ea437202a60078a512b8f1114cfea3 Reviewed-on: http://codereview.qt.nokia.com/1138 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/declarative/particles')
-rw-r--r--src/declarative/particles/qsgparticlesystem.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/declarative/particles/qsgparticlesystem.cpp b/src/declarative/particles/qsgparticlesystem.cpp
index d648d46330..97c73dca8e 100644
--- a/src/declarative/particles/qsgparticlesystem.cpp
+++ b/src/declarative/particles/qsgparticlesystem.cpp
@@ -739,8 +739,12 @@ int QSGParticleSystem::nextSystemIndex()
m_reusableIndexes.remove(ret);
return ret;
}
- if (m_nextIndex >= m_bySysIdx.size())
+ if (m_nextIndex >= m_bySysIdx.size()){
m_bySysIdx.resize(m_bySysIdx.size() < 10 ? 10 : m_bySysIdx.size()*1.1);//###+1,10%,+10? Choose something non-arbitrarily
+ if (m_spriteEngine)
+ m_spriteEngine->setCount(m_bySysIdx.size());
+
+ }
return m_nextIndex++;
}