Sergio Gómez Del Rea =?UTF-8?Q?l=20?=: ole32: Correctly save the dib format if its data has not been set.
Alexandre Julliard
julliard at winehq.org
Thu Dec 14 15:31:52 CST 2017
Module: wine
Branch: master
Commit: 179daf67a82945ee41f45f24d4bbf8f31fc2d7d1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=179daf67a82945ee41f45f24d4bbf8f31fc2d7d1
Author: Sergio Gómez Del Real <sdelreal at codeweavers.com>
Date: Thu Dec 14 13:17:37 2017 +0000
ole32: Correctly save the dib format if its data has not been set.
Signed-off-by: Sergio Gómez Del Real <sdelreal at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ole32/datacache.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c
index 75c9611..ae05b8e 100644
--- a/dlls/ole32/datacache.c
+++ b/dlls/ole32/datacache.c
@@ -792,8 +792,14 @@ static void init_stream_header(DataCacheEntry *entry, PresentationDataHeader *he
static HRESULT save_dib(DataCacheEntry *entry, BOOL contents, IStream *stream)
{
HRESULT hr = S_OK;
- int data_size = GlobalSize(entry->stgmedium.u.hGlobal);
- BITMAPINFO *bmi = GlobalLock(entry->stgmedium.u.hGlobal);
+ int data_size = 0;
+ BITMAPINFO *bmi = NULL;
+
+ if (entry->stgmedium.tymed != TYMED_NULL)
+ {
+ data_size = GlobalSize(entry->stgmedium.u.hGlobal);
+ bmi = GlobalLock(entry->stgmedium.u.hGlobal);
+ }
if (!contents)
{
More information about the wine-cvs
mailing list