usp10: Fix possible crashes (clang)

André Hentschel nerv at dawncrow.de
Wed Jul 13 13:46:42 CDT 2011


At function start the use of psa get's checked before, but here not.
---
 dlls/usp10/usp10.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c
index afc4e72..50de8bf 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -1612,7 +1612,7 @@ HRESULT WINAPI ScriptShapeOpenType( HDC hdc, SCRIPT_CACHE *psc,
     if (cRanges)
         FIXME("Ranges not supported yet\n");
 
-    rtl = (!psa->fLogicalOrder && psa->fRTL);
+    rtl = (psa && !psa->fLogicalOrder && psa->fRTL);
 
     *pcGlyphs = cChars;
     if ((hr = init_script_cache(hdc, psc)) != S_OK) return hr;
@@ -1640,7 +1640,7 @@ HRESULT WINAPI ScriptShapeOpenType( HDC hdc, SCRIPT_CACHE *psc,
         pwLogClust[i] = idx;
     }
 
-    if (!psa->fNoGlyphIndex)
+    if (psa && !psa->fNoGlyphIndex)
     {
         WCHAR *rChars;
         if ((hr = SHAPE_CheckFontForRequiredFeatures(hdc, (ScriptCache *)*psc, psa)) != S_OK) return hr;
-- 

Best Regards, André Hentschel



More information about the wine-patches mailing list