[AT-SPI] Fixed uint underflow risk
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-editor-impl.cpp
index 7b4e8a2..4650a6d 100644 (file)
@@ -1999,7 +1999,7 @@ Dali::Accessibility::Range TextEditor::AccessibleImpl::GetTextAtOffset(
             if (boundary == Dali::Accessibility::TextBoundary::LINE)
               counter++;
           }
-          if ((counter - 1) == offset)
+          if ((counter > 0) && ((counter - 1) == offset))
           {
             range.content = txt.substr(start, index - start + 1);
             range.startOffset = start;