From 3c0d8ca9a563d20457f13d907306f350ee269273 Mon Sep 17 00:00:00 2001
From: tatyana <tatyana@etersoft.ru>
Date: Mon, 27 May 2013 14:43:38 +0400
Subject: [PATCH 1/2] oleaut32: Ignore NULL ppTLib/pIndex in
 ITypeInfo2_fnGetContainingTypeLib.

---
 dlls/oleaut32/typelib2.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/oleaut32/typelib2.c b/dlls/oleaut32/typelib2.c
index 1aeb27a..98f9d62 100644
--- a/dlls/oleaut32/typelib2.c
+++ b/dlls/oleaut32/typelib2.c
@@ -3707,9 +3707,12 @@ static HRESULT WINAPI ITypeInfo2_fnGetContainingTypeLib(
 
     TRACE("(%p,%p,%p)\n", iface, ppTLib, pIndex);
 
-    *ppTLib = (ITypeLib *)&This->typelib->ITypeLib2_iface;
-    ICreateTypeLib_AddRef((ICreateTypeLib*)This->typelib);
-    *pIndex = This->typeinfo->typekind >> 16;
+    if (ppTLib)
+    {
+        *ppTLib = (ITypeLib *)&This->typelib->ITypeLib2_iface;
+        ICreateTypeLib2_AddRef(&This->typelib->ICreateTypeLib2_iface);
+    }
+    if (pIndex) *pIndex = This->typeinfo->typekind >> 16;
 
     return S_OK;
 }
-- 
1.8.1.6
