diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2024-01-15 15:15:12 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-01-26 05:18:07 +0000 |
commit | aacf2ec03c43d1075ff54d2ac60e38b6ebd09252 (patch) | |
tree | 8e69101383555ef53fb3282b0aeadfd7a66b6e24 | |
parent | 6914f7ce3b611b806562e44fd6ae7716a307de56 (diff) |
QCocoaA(11)y: do not try to access an element if rowIndex == -1
This ends up in out of bounds exception.
Fixes: QTBUG-120469
Fixes: QTBUG-121008
Change-Id: Id895f311bbb59a3734ecadd0d2472a4018332e16
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 75a918d487aabacd2d377e1e79baea7d30deb5ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1e0a6b31603fdb95232e8210512c9ad92ef372af)
(cherry picked from commit b97d45c99dc2140c248c9b59727574cd21b7b81f)
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm index e2f5092cce..ec9cf9aa13 100644 --- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm +++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm @@ -537,7 +537,7 @@ static void convertLineOffset(QAccessibleTextInterface *text, int *line, int *of else if (QAccessibleTableCellInterface *cell = iface->tableCellInterface()) rowIndex = cell->rowIndex(); Q_ASSERT(tableElement->rows); - if (rowIndex > int([tableElement->rows count])) + if (rowIndex > int([tableElement->rows count]) || rowIndex == -1) return nil; QMacAccessibilityElement *rowElement = tableElement->rows[rowIndex]; return NSAccessibilityUnignoredAncestor(rowElement); |