Kaydet (Commit) d9ac156b authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud Kaydeden (comit) Michael Stahl

coverity#1038307 Negative loop bound

Change-Id: Ib0ca4fc350d84e25283e261cb9f48b0f6f22e81b
Reviewed-on: https://gerrit.libreoffice.org/4556Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst 3f8445b2
...@@ -1893,6 +1893,9 @@ void ImpEditEngine::InitWritingDirections( sal_Int32 nPara ) ...@@ -1893,6 +1893,9 @@ void ImpEditEngine::InitWritingDirections( sal_Int32 nPara )
size_t nCount = ubidi_countRuns( pBidi, &nError ); size_t nCount = ubidi_countRuns( pBidi, &nError );
/* ubidi_countRuns can return -1 in case of error */
if(nCount > 0)
{
int32_t nStart = 0; int32_t nStart = 0;
int32_t nEnd; int32_t nEnd;
UBiDiLevel nCurrDir; UBiDiLevel nCurrDir;
...@@ -1903,6 +1906,7 @@ void ImpEditEngine::InitWritingDirections( sal_Int32 nPara ) ...@@ -1903,6 +1906,7 @@ void ImpEditEngine::InitWritingDirections( sal_Int32 nPara )
rInfos.push_back( WritingDirectionInfo( nCurrDir, (sal_uInt16)nStart, (sal_uInt16)nEnd ) ); rInfos.push_back( WritingDirectionInfo( nCurrDir, (sal_uInt16)nStart, (sal_uInt16)nEnd ) );
nStart = nEnd; nStart = nEnd;
} }
}
ubidi_close( pBidi ); ubidi_close( pBidi );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment