[1/4] windowscodecs: Protect from invalid input some metadata handler methods.

Dmitry Timoshkov dmitry at baikal.ru
Wed Jun 6 23:21:48 CDT 2012


Please apply this set after
"windowscodecs: Add metadata reader information to the registry."

---
 dlls/windowscodecs/metadatahandler.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/windowscodecs/metadatahandler.c b/dlls/windowscodecs/metadatahandler.c
index afcff21..013fe04 100644
--- a/dlls/windowscodecs/metadatahandler.c
+++ b/dlls/windowscodecs/metadatahandler.c
@@ -133,6 +133,8 @@ static ULONG WINAPI MetadataHandler_Release(IWICMetadataWriter *iface)
 static HRESULT WINAPI MetadataHandler_GetMetadataFormat(IWICMetadataWriter *iface,
     GUID *pguidMetadataFormat)
 {
+    if (!pguidMetadataFormat) return E_INVALIDARG;
+
     FIXME("(%p,%s): stub\n", iface, debugstr_guid(pguidMetadataFormat));
     return E_NOTIMPL;
 }
@@ -147,6 +149,8 @@ static HRESULT WINAPI MetadataHandler_GetMetadataHandlerInfo(IWICMetadataWriter
 static HRESULT WINAPI MetadataHandler_GetCount(IWICMetadataWriter *iface,
     UINT *pcCount)
 {
+    if (!pcCount) return E_INVALIDARG;
+
     FIXME("(%p,%p): stub\n", iface, pcCount);
     return E_NOTIMPL;
 }
@@ -514,6 +518,8 @@ static HRESULT MetadataHandlerEnum_Create(MetadataHandler *parent, DWORD index,
 {
     MetadataHandlerEnum *This;
 
+    if (!ppIEnumMetadataItem) return E_INVALIDARG;
+
     *ppIEnumMetadataItem = NULL;
 
     This = HeapAlloc(GetProcessHeap(), 0, sizeof(MetadataHandlerEnum));
-- 
1.7.10.1




More information about the wine-patches mailing list