ole32: Correctly save the dib format if its data has not been set.

Signed-off-by: Sergio Gómez Del Real <sdelreal@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Sergio Gómez Del Real 2017-12-14 13:17:37 +00:00 committed by Alexandre Julliard
parent dfb09f4807
commit 179daf67a8
1 changed files with 8 additions and 2 deletions

View File

@ -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)
{