Sebastian Lackner : user32: Add missing calls to GlobalUnlock in render_synthesized_dib.

Alexandre Julliard julliard at winehq.org
Thu Sep 8 10:39:21 CDT 2016


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

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Wed Sep  7 20:52:35 2016 +0200

user32: Add missing calls to GlobalUnlock in render_synthesized_dib.

Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/clipboard.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/dlls/user32/clipboard.c b/dlls/user32/clipboard.c
index f6f073e..135790a 100644
--- a/dlls/user32/clipboard.c
+++ b/dlls/user32/clipboard.c
@@ -283,13 +283,16 @@ static HANDLE render_synthesized_dib( HANDLE data, UINT format, UINT from )
         header_size = (format == CF_DIBV5) ? sizeof(BITMAPV5HEADER) :
             offsetof( BITMAPINFO, bmiColors[src->bmiHeader.biCompression == BI_BITFIELDS ? 3 : 0] );
 
-        if (!(ret = GlobalAlloc( GMEM_FIXED, header_size + bits_size ))) goto done;
-        bmi = (BITMAPINFO *)ret;
-        memset( bmi, 0, header_size );
-        memcpy( bmi, src, min( header_size, src_size ));
-        bmi->bmiHeader.biSize = header_size;
-        /* FIXME: convert colors according to DIBv5 color profile */
-        memcpy( (char *)bmi + header_size, (char *)src + src_size, bits_size );
+        if ((ret = GlobalAlloc( GMEM_FIXED, header_size + bits_size )))
+        {
+            bmi = (BITMAPINFO *)ret;
+            memset( bmi, 0, header_size );
+            memcpy( bmi, src, min( header_size, src_size ));
+            bmi->bmiHeader.biSize = header_size;
+            /* FIXME: convert colors according to DIBv5 color profile */
+            memcpy( (char *)bmi + header_size, (char *)src + src_size, bits_size );
+        }
+        GlobalUnlock( data );
     }
 
 done:




More information about the wine-cvs mailing list