Alexander Scott-Johns : ole32: Fix error handling in get_data_from_metafilepict and get_data_from_bitmap.

Alexandre Julliard julliard at winehq.org
Mon Jan 31 11:26:15 CST 2011


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

Author: Alexander Scott-Johns <alexander.scott.johns at googlemail.com>
Date:   Fri Jan 28 19:49:50 2011 +0000

ole32: Fix error handling in get_data_from_metafilepict and get_data_from_bitmap.

---

 dlls/ole32/clipboard.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c
index b59b554..b98404f 100644
--- a/dlls/ole32/clipboard.c
+++ b/dlls/ole32/clipboard.c
@@ -876,9 +876,8 @@ static HRESULT get_data_from_metafilepict(IDataObject *data, FORMATETC *fmt, HGL
     if(FAILED(hr)) return hr;
 
     hr = dup_metafilepict(med.u.hMetaFilePict, &copy);
-    if(FAILED(hr)) return hr;
 
-    *mem = copy;
+    if(SUCCEEDED(hr)) *mem = copy;
 
     ReleaseStgMedium(&med);
 
@@ -906,10 +905,8 @@ static HRESULT get_data_from_bitmap(IDataObject *data, FORMATETC *fmt, HBITMAP *
     if(FAILED(hr)) return hr;
 
     hr = dup_bitmap(med.u.hBitmap, &copy);
-    if(FAILED(hr)) return hr;
 
-    if(hbm) *hbm = copy;
-    else hr = E_FAIL;
+    if(SUCCEEDED(hr)) *hbm = copy;
 
     ReleaseStgMedium(&med);
 




More information about the wine-cvs mailing list