riched20: Handle range method failures in InRange (Coverity).

This commit is contained in:
Nikolay Sivov 2015-06-07 23:41:12 +03:00 committed by Alexandre Julliard
parent 3889dadcca
commit 2688363714
1 changed files with 5 additions and 4 deletions

View File

@ -2006,10 +2006,11 @@ static HRESULT textrange_inrange(LONG start, LONG end, ITextRange *range, LONG *
if (!ret)
ret = &v;
ITextRange_GetStart(range, &from);
ITextRange_GetEnd(range, &to);
*ret = (start >= from && end <= to) ? tomTrue : tomFalse;
if (FAILED(ITextRange_GetStart(range, &from)) || FAILED(ITextRange_GetEnd(range, &to))) {
*ret = tomFalse;
}
else
*ret = (start >= from && end <= to) ? tomTrue : tomFalse;
return *ret == tomTrue ? S_OK : S_FALSE;
}