[PATCH 1/2] ole32: Correctly save the dib format if its data has not been set.
Huw Davies
huw at codeweavers.com
Thu Dec 14 07:17:37 CST 2017
From: Sergio Gómez Del Real <sdelreal at codeweavers.com>
Regression is reported at https://bugs.winehq.org/show_bug.cgi?id=44147
Signed-off-by: Sergio Gómez Del Real <sdelreal at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
---
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 75c961164e..ae05b8e176 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)
{
--
2.12.0
More information about the wine-devel
mailing list