From adbcfacb8c8a0fb6e104bd57aac93f2dd09f3372 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Tue, 24 Jul 2012 15:05:18 +0900 Subject: [PATCH] windowscodecs: Do not assume that vtable is the first element of the object, avoid not necessary casts. --- dlls/windowscodecs/converter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c index 6ee3a165ea2..8611560ca1b 100644 --- a/dlls/windowscodecs/converter.c +++ b/dlls/windowscodecs/converter.c @@ -852,7 +852,7 @@ static HRESULT WINAPI FormatConverter_QueryInterface(IWICFormatConverter *iface, IsEqualIID(&IID_IWICBitmapSource, iid) || IsEqualIID(&IID_IWICFormatConverter, iid)) { - *ppv = This; + *ppv = &This->IWICFormatConverter_iface; } else { @@ -1103,8 +1103,8 @@ HRESULT FormatConverter_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** p InitializeCriticalSection(&This->lock); This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": FormatConverter.lock"); - ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); - IUnknown_Release((IUnknown*)This); + ret = IWICFormatConverter_QueryInterface(&This->IWICFormatConverter_iface, iid, ppv); + IWICFormatConverter_Release(&This->IWICFormatConverter_iface); return ret; } -- 2.11.4.GIT