From: Frederik Gladhorn Date: Sat, 22 Sep 2012 16:37:21 +0000 (+0200) Subject: Accessibility: rather than assert, just warn. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e8ca2e008f52a818884b151dd93226813832ef94;p=profile%2Fivi%2Fqtbase.git Accessibility: rather than assert, just warn. Screen readers do random things with the dbus interface, we should be careful when handling what they send. Change-Id: Ie8fc515c8d399dae9b5e892a135b54a1820d09e2 Reviewed-by: Jan Arve Sæther Reviewed-by: Marc Mutz --- diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp index d4462c8..2d6a103 100644 --- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp +++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp @@ -2144,11 +2144,13 @@ bool AtSpiAdaptor::tableInterface(const QAIPointer &interface, const QString &fu } else if (function == QLatin1String("GetAccessibleAt")) { int row = message.arguments().at(0).toInt(); int column = message.arguments().at(1).toInt(); - Q_ASSERT(interface->tableInterface()); - Q_ASSERT(row >= 0); - Q_ASSERT(column >= 0); - Q_ASSERT(row < interface->tableInterface()->rowCount()); - Q_ASSERT(column < interface->tableInterface()->columnCount()); + if ((row < 0) || + (column < 0) || + (row >= interface->tableInterface()->rowCount()) || + (column >= interface->tableInterface()->columnCount())) { + qWarning() << "WARNING: invalid index for tableInterface GetAccessibleAt (" << row << ", " << column << ")"; + return false; + } QSpiObjectReference ref; QAIPointer cell(interface->tableInterface()->cellAt(row, column));