Module: wine Branch: master Commit: 6f99f196fc0bf48583a45ef1114e8a571f4dc3a6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=6f99f196fc0bf48583a45ef111...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Wed Jun 3 18:57:54 2015 +0300
dwrite: Fix potential null pointer access in GetFontCollection() (Coverity).
---
dlls/dwrite/layout.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c index 365f0b2..8f42433 100644 --- a/dlls/dwrite/layout.c +++ b/dlls/dwrite/layout.c @@ -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);