Commit 19479795 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

windowscodecs: Do not assume that vtable is the first element of the object,…

windowscodecs: Do not assume that vtable is the first element of the object, avoid not necessary casts.
parent f97bc0fa
...@@ -72,7 +72,7 @@ static HRESULT WINAPI GifFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface ...@@ -72,7 +72,7 @@ static HRESULT WINAPI GifFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface
IsEqualIID(&IID_IWICBitmapSource, iid) || IsEqualIID(&IID_IWICBitmapSource, iid) ||
IsEqualIID(&IID_IWICBitmapFrameDecode, iid)) IsEqualIID(&IID_IWICBitmapFrameDecode, iid))
{ {
*ppv = This; *ppv = &This->IWICBitmapFrameDecode_iface;
} }
else else
{ {
...@@ -299,9 +299,10 @@ static HRESULT WINAPI GifDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID ...@@ -299,9 +299,10 @@ static HRESULT WINAPI GifDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID
if (!ppv) return E_INVALIDARG; if (!ppv) return E_INVALIDARG;
if (IsEqualIID(&IID_IUnknown, iid) || IsEqualIID(&IID_IWICBitmapDecoder, iid)) if (IsEqualIID(&IID_IUnknown, iid) ||
IsEqualIID(&IID_IWICBitmapDecoder, iid))
{ {
*ppv = This; *ppv = &This->IWICBitmapDecoder_iface;
} }
else else
{ {
...@@ -507,7 +508,7 @@ static HRESULT WINAPI GifDecoder_GetFrame(IWICBitmapDecoder *iface, ...@@ -507,7 +508,7 @@ static HRESULT WINAPI GifDecoder_GetFrame(IWICBitmapDecoder *iface,
IWICBitmapDecoder_AddRef(iface); IWICBitmapDecoder_AddRef(iface);
result->parent = This; result->parent = This;
*ppIBitmapFrame = (IWICBitmapFrameDecode*)result; *ppIBitmapFrame = &result->IWICBitmapFrameDecode_iface;
return S_OK; return S_OK;
} }
...@@ -550,8 +551,8 @@ HRESULT GifDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) ...@@ -550,8 +551,8 @@ HRESULT GifDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
InitializeCriticalSection(&This->lock); InitializeCriticalSection(&This->lock);
This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": GifDecoder.lock"); This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": GifDecoder.lock");
ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); ret = IWICBitmapDecoder_QueryInterface(&This->IWICBitmapDecoder_iface, iid, ppv);
IUnknown_Release((IUnknown*)This); IWICBitmapDecoder_Release(&This->IWICBitmapDecoder_iface);
return ret; return ret;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment