From 8349a9f52e89b0fd96ba3ad159cd3ffdabbb27c8 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Fri, 29 Feb 2008 15:36:04 +0100 Subject: [PATCH] mscms: Create a copy of memory based profiles. --- dlls/mscms/profile.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dlls/mscms/profile.c b/dlls/mscms/profile.c index 9122eccc9af..76a8168b6c7 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 ) ); -- 2.11.4.GIT