Skip to content
Snippets Groups Projects
Commit 8dfca822 authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee
Browse files

bookmark: Fix invalid memory access

Refs #72255
parent dab9b664
Branches
No related tags found
No related merge requests found
...@@ -336,7 +336,7 @@ QModelIndex CategorizedBookmarkModel::parent( const QModelIndex& idx) const ...@@ -336,7 +336,7 @@ QModelIndex CategorizedBookmarkModel::parent( const QModelIndex& idx) const
///Get the index ///Get the index
QModelIndex CategorizedBookmarkModel::index(int row, int column, const QModelIndex& parent) const QModelIndex CategorizedBookmarkModel::index(int row, int column, const QModelIndex& parent) const
{ {
if (parent.isValid() && !column) if (parent.isValid() && (!column) && d_ptr->m_lCategoryCounter.size() > parent.row() && d_ptr->m_lCategoryCounter[parent.row()]->m_lChildren.size() > row)
return createIndex(row,column,(void*) static_cast<CategorizedCompositeNode*>(d_ptr->m_lCategoryCounter[parent.row()]->m_lChildren[row])); return createIndex(row,column,(void*) static_cast<CategorizedCompositeNode*>(d_ptr->m_lCategoryCounter[parent.row()]->m_lChildren[row]));
else if (row >= 0 && row < d_ptr->m_lCategoryCounter.size() && !column) { else if (row >= 0 && row < d_ptr->m_lCategoryCounter.size() && !column) {
return createIndex(row,column,(void*) static_cast<CategorizedCompositeNode*>(d_ptr->m_lCategoryCounter[row])); return createIndex(row,column,(void*) static_cast<CategorizedCompositeNode*>(d_ptr->m_lCategoryCounter[row]));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment