[2/3] user32: Add missing calls to GlobalUnlock in render_synthesized_dib.
Sebastian Lackner
sebastian at fds-team.de
Wed Sep 7 13:52:35 CDT 2016
Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
---
These seem to be missing, or are they left out intentionally? Other render_*()
functions properly unlock the clipboard data.
dlls/user32/clipboard.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/clipboard.c b/dlls/user32/clipboard.c
index f6f073e..d50c759 100644
--- a/dlls/user32/clipboard.c
+++ b/dlls/user32/clipboard.c
@@ -283,13 +283,18 @@ 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;
+ if (!(ret = GlobalAlloc( GMEM_FIXED, header_size + bits_size )))
+ {
+ GlobalUnlock( data );
+ 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 );
+ GlobalUnlock( data );
}
done:
--
2.9.0
More information about the wine-patches
mailing list