summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-03-19 07:34:30 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-03-19 07:34:30 (GMT)
commit55ffc0f27638485803f29d985a57deb5b3db4584 (patch)
tree4c5fccfa52eb5be6808193a9ba686a804eac59f4 /src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
parentfd520c032eabab22acfabe9ffdc5929e168a279f (diff)
downloadQt-55ffc0f27638485803f29d985a57deb5b3db4584.zip
Qt-55ffc0f27638485803f29d985a57deb5b3db4584.tar.gz
Qt-55ffc0f27638485803f29d985a57deb5b3db4584.tar.bz2
Don't crash if an out of bounds model index is accessed.
Task-number: QTBUG-9184
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index 6341764..b31bbd0 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -422,6 +422,8 @@ int QDeclarativeVisualDataModelDataMetaObject::createProperty(const char *name,
return -1;
QDeclarativeVisualDataModelPrivate *model = QDeclarativeVisualDataModelPrivate::get(data->m_model);
+ if (data->m_index < 0 || data->m_index >= model->modelCount())
+ return -1;
if ((!model->m_listModelInterface || !model->m_abstractItemModel) && model->m_listAccessor) {
if (model->m_listAccessor->type() == QDeclarativeListAccessor::ListProperty) {