[3/4] oleaut32: Always write header to stream when saving an icon.

Dmitry Timoshkov dmitry at baikal.ru
Fri Jun 1 01:37:29 CDT 2012


This matches what the code does when saving a bitmap and unifies icon and
bitmap saving code paths.
---
 dlls/oleaut32/olepicture.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
index d838920..db3b852 100644
--- a/dlls/oleaut32/olepicture.c
+++ b/dlls/oleaut32/olepicture.c
@@ -1768,15 +1768,11 @@ static HRESULT WINAPI OLEPictureImpl_Save(
             This->data = pIconData;
             This->datalen = iDataSize;
         }
-        if (This->loadtime_magic != 0xdeadbeef) {
-            DWORD header[2];
 
-            header[0] = This->loadtime_magic;
-            header[1] = This->datalen;
-            IStream_Write(pStm, header, 2 * sizeof(DWORD), &dummy);
-        }
+        header[0] = (This->loadtime_magic != 0xdeadbeef) ? This->loadtime_magic : 0x0000746c;
+        header[1] = This->datalen;
+        IStream_Write(pStm, header, 2 * sizeof(DWORD), &dummy);
         IStream_Write(pStm, This->data, This->datalen, &dummy);
-
         hResult = S_OK;
         break;
     case PICTYPE_BITMAP:
-- 
1.7.10.1




More information about the wine-patches mailing list