dwrite: Fix potential null pointer access in GetFontCollection() (Coverity).

This commit is contained in:
Nikolay Sivov 2015-06-03 18:57:54 +03:00 committed by Alexandre Julliard
parent 1d08eb284a
commit 6f99f196fc
1 changed files with 4 additions and 1 deletions

View File

@ -1863,8 +1863,11 @@ static HRESULT WINAPI dwritetextlayout_layout_GetFontCollection(IDWriteTextLayou
TRACE("(%p)->(%u %p %p)\n", This, position, collection, r);
if (position >= This->len)
return S_OK;
range = get_layout_range_by_pos(This, position);
*collection = range ? range->collection : NULL;
*collection = range->collection;
if (*collection)
IDWriteFontCollection_AddRef(*collection);