ole32: Fix error handling in get_data_from_metafilepict and get_data_from_bitmap.

Alexander Scott-Johns alexander.scott.johns at googlemail.com
Fri Jan 28 13:56:49 CST 2011


-------------- next part --------------
From ae2ff11e3dbc41ff7458aab182b819d78820efa5 Mon Sep 17 00:00:00 2001
From: Alexander Scott-Johns <alexander.scott.johns at googlemail.com>
Date: Fri, 28 Jan 2011 19:49:50 +0000
Subject: 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);
 
-- 
1.7.0.4


More information about the wine-patches mailing list