Dmitry Timoshkov : windowscodecs: Do not assume that vtable is the first element of the object.

Alexandre Julliard julliard at winehq.org
Tue Jul 24 14:39:36 CDT 2012


Module: wine
Branch: master
Commit: 022824100e94b3af8fc85f3e3d6efcc7623cfb11
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=022824100e94b3af8fc85f3e3d6efcc7623cfb11

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Tue Jul 24 15:01:27 2012 +0900

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

---

 dlls/windowscodecs/bmpdecode.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/windowscodecs/bmpdecode.c b/dlls/windowscodecs/bmpdecode.c
index 6da6a3c..1a1ee0a 100644
--- a/dlls/windowscodecs/bmpdecode.c
+++ b/dlls/windowscodecs/bmpdecode.c
@@ -94,6 +94,8 @@ static inline BmpDecoder *impl_from_IWICBitmapFrameDecode(IWICBitmapFrameDecode
 static HRESULT WINAPI BmpFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface, REFIID iid,
     void **ppv)
 {
+    BmpDecoder *This = impl_from_IWICBitmapFrameDecode(iface);
+
     TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv);
 
     if (!ppv) return E_INVALIDARG;
@@ -102,7 +104,7 @@ static HRESULT WINAPI BmpFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface
         IsEqualIID(&IID_IWICBitmapSource, iid) ||
         IsEqualIID(&IID_IWICBitmapFrameDecode, iid))
     {
-        *ppv = iface;
+        *ppv = &This->IWICBitmapFrameDecode_iface;
     }
     else
     {
@@ -964,9 +966,10 @@ static HRESULT WINAPI BmpDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID
 
     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
     {




More information about the wine-cvs mailing list