Hans Leidekker : mscms: Create a copy of memory based profiles.

Alexandre Julliard julliard at winehq.org
Fri Feb 29 14:20:37 CST 2008


Module: wine
Branch: master
Commit: 8349a9f52e89b0fd96ba3ad159cd3ffdabbb27c8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8349a9f52e89b0fd96ba3ad159cd3ffdabbb27c8

Author: Hans Leidekker <hans at it.vu.nl>
Date:   Fri Feb 29 15:36:04 2008 +0100

mscms: Create a copy of memory based profiles.

---

 dlls/mscms/profile.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/dlls/mscms/profile.c b/dlls/mscms/profile.c
index 9122ecc..76a8168 100644
--- a/dlls/mscms/profile.c
+++ b/dlls/mscms/profile.c
@@ -1371,7 +1371,6 @@ HPROFILE WINAPI OpenColorProfileW( PPROFILE profile, DWORD access, DWORD sharing
     cmsHPROFILE cmsprofile = NULL;
     icProfile *iccprofile = NULL;
     HANDLE handle = INVALID_HANDLE_VALUE;
-    DWORD size;
 
     TRACE( "( %p, 0x%08x, 0x%08x, 0x%08x )\n", profile, access, sharing, creation );
 
@@ -1381,14 +1380,14 @@ HPROFILE WINAPI OpenColorProfileW( PPROFILE profile, DWORD access, DWORD sharing
     {
         /* FIXME: access flags not implemented for memory based profiles */
 
-        iccprofile = profile->pProfileData;
-        size = profile->cbDataSize;
-    
-        cmsprofile = cmsOpenProfileFromMem( iccprofile, size );
+        if (!(iccprofile = HeapAlloc( GetProcessHeap(), 0, profile->cbDataSize ))) return NULL;
+        memcpy( iccprofile, profile->pProfileData, profile->cbDataSize );
+
+        cmsprofile = cmsOpenProfileFromMem( iccprofile, profile->cbDataSize );
     }
     else if (profile->dwType == PROFILE_FILENAME)
     {
-        DWORD read, flags = 0;
+        DWORD size, read, flags = 0;
 
         TRACE( "profile file: %s\n", debugstr_w( (WCHAR *)profile->pProfileData ) );
 




More information about the wine-cvs mailing list