Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
872fded8
Commit
872fded8
authored
Oct 18, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mscms: Fix a memory leak in TranslateColors.
parent
463dafc3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
32 deletions
+41
-32
transform.c
dlls/mscms/transform.c
+41
-32
No files found.
dlls/mscms/transform.c
View file @
872fded8
...
...
@@ -355,8 +355,8 @@ BOOL WINAPI TranslateBitmapBits( HTRANSFORM handle, PVOID srcbits, BMFORMAT inpu
BOOL
WINAPI
TranslateColors
(
HTRANSFORM
handle
,
PCOLOR
in
,
DWORD
count
,
COLORTYPE
input_type
,
PCOLOR
out
,
COLORTYPE
output_type
)
{
BOOL
ret
=
FALSE
;
#ifdef HAVE_LCMS
BOOL
ret
=
TRUE
;
struct
transform
*
transform
=
grab_transform
(
handle
);
cmsHTRANSFORM
xfrm
;
unsigned
int
i
;
...
...
@@ -374,78 +374,87 @@ BOOL WINAPI TranslateColors( HTRANSFORM handle, PCOLOR in, DWORD count,
{
switch
(
output_type
)
{
case
COLOR_RGB
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
rgb
,
&
out
[
i
].
rgb
,
1
);
return
TRUE
;
case
COLOR_Lab
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
rgb
,
&
out
[
i
].
Lab
,
1
);
return
TRUE
;
case
COLOR_GRAY
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
rgb
,
&
out
[
i
].
gray
,
1
);
return
TRUE
;
case
COLOR_CMYK
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
rgb
,
&
out
[
i
].
cmyk
,
1
);
return
TRUE
;
case
COLOR_XYZ
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
rgb
,
&
out
[
i
].
XYZ
,
1
);
return
TRUE
;
case
COLOR_RGB
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
rgb
,
&
out
[
i
].
rgb
,
1
);
goto
done
;
case
COLOR_Lab
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
rgb
,
&
out
[
i
].
Lab
,
1
);
goto
done
;
case
COLOR_GRAY
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
rgb
,
&
out
[
i
].
gray
,
1
);
goto
done
;
case
COLOR_CMYK
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
rgb
,
&
out
[
i
].
cmyk
,
1
);
goto
done
;
case
COLOR_XYZ
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
rgb
,
&
out
[
i
].
XYZ
,
1
);
goto
done
;
default:
FIXME
(
"unhandled input/output pair: %d/%d
\n
"
,
input_type
,
output_type
);
return
FALSE
;
ret
=
FALSE
;
break
;
}
}
case
COLOR_Lab
:
{
switch
(
output_type
)
{
case
COLOR_RGB
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
Lab
,
&
out
[
i
].
rgb
,
1
);
return
TRUE
;
case
COLOR_Lab
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
Lab
,
&
out
[
i
].
Lab
,
1
);
return
TRUE
;
case
COLOR_GRAY
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
Lab
,
&
out
[
i
].
gray
,
1
);
return
TRUE
;
case
COLOR_CMYK
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
Lab
,
&
out
[
i
].
cmyk
,
1
);
return
TRUE
;
case
COLOR_XYZ
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
Lab
,
&
out
[
i
].
XYZ
,
1
);
return
TRUE
;
case
COLOR_RGB
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
Lab
,
&
out
[
i
].
rgb
,
1
);
goto
done
;
case
COLOR_Lab
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
Lab
,
&
out
[
i
].
Lab
,
1
);
goto
done
;
case
COLOR_GRAY
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
Lab
,
&
out
[
i
].
gray
,
1
);
goto
done
;
case
COLOR_CMYK
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
Lab
,
&
out
[
i
].
cmyk
,
1
);
goto
done
;
case
COLOR_XYZ
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
Lab
,
&
out
[
i
].
XYZ
,
1
);
goto
done
;
default:
FIXME
(
"unhandled input/output pair: %d/%d
\n
"
,
input_type
,
output_type
);
return
FALSE
;
ret
=
FALSE
;
break
;
}
}
case
COLOR_GRAY
:
{
switch
(
output_type
)
{
case
COLOR_RGB
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
gray
,
&
out
[
i
].
rgb
,
1
);
return
TRUE
;
case
COLOR_Lab
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
gray
,
&
out
[
i
].
Lab
,
1
);
return
TRUE
;
case
COLOR_GRAY
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
gray
,
&
out
[
i
].
gray
,
1
);
return
TRUE
;
case
COLOR_CMYK
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
gray
,
&
out
[
i
].
cmyk
,
1
);
return
TRUE
;
case
COLOR_XYZ
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
gray
,
&
out
[
i
].
XYZ
,
1
);
return
TRUE
;
case
COLOR_RGB
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
gray
,
&
out
[
i
].
rgb
,
1
);
goto
done
;
case
COLOR_Lab
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
gray
,
&
out
[
i
].
Lab
,
1
);
goto
done
;
case
COLOR_GRAY
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
gray
,
&
out
[
i
].
gray
,
1
);
goto
done
;
case
COLOR_CMYK
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
gray
,
&
out
[
i
].
cmyk
,
1
);
goto
done
;
case
COLOR_XYZ
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
gray
,
&
out
[
i
].
XYZ
,
1
);
goto
done
;
default:
FIXME
(
"unhandled input/output pair: %d/%d
\n
"
,
input_type
,
output_type
);
return
FALSE
;
ret
=
FALSE
;
break
;
}
}
case
COLOR_CMYK
:
{
switch
(
output_type
)
{
case
COLOR_RGB
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
cmyk
,
&
out
[
i
].
rgb
,
1
);
return
TRUE
;
case
COLOR_Lab
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
cmyk
,
&
out
[
i
].
Lab
,
1
);
return
TRUE
;
case
COLOR_GRAY
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
cmyk
,
&
out
[
i
].
gray
,
1
);
return
TRUE
;
case
COLOR_CMYK
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
cmyk
,
&
out
[
i
].
cmyk
,
1
);
return
TRUE
;
case
COLOR_XYZ
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
cmyk
,
&
out
[
i
].
XYZ
,
1
);
return
TRUE
;
case
COLOR_RGB
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
cmyk
,
&
out
[
i
].
rgb
,
1
);
goto
done
;
case
COLOR_Lab
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
cmyk
,
&
out
[
i
].
Lab
,
1
);
goto
done
;
case
COLOR_GRAY
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
cmyk
,
&
out
[
i
].
gray
,
1
);
goto
done
;
case
COLOR_CMYK
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
cmyk
,
&
out
[
i
].
cmyk
,
1
);
goto
done
;
case
COLOR_XYZ
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
cmyk
,
&
out
[
i
].
XYZ
,
1
);
goto
done
;
default:
FIXME
(
"unhandled input/output pair: %d/%d
\n
"
,
input_type
,
output_type
);
return
FALSE
;
ret
=
FALSE
;
break
;
}
}
case
COLOR_XYZ
:
{
switch
(
output_type
)
{
case
COLOR_RGB
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
XYZ
,
&
out
[
i
].
rgb
,
1
);
return
TRUE
;
case
COLOR_Lab
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
XYZ
,
&
out
[
i
].
Lab
,
1
);
return
TRUE
;
case
COLOR_GRAY
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
XYZ
,
&
out
[
i
].
gray
,
1
);
return
TRUE
;
case
COLOR_CMYK
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
XYZ
,
&
out
[
i
].
cmyk
,
1
);
return
TRUE
;
case
COLOR_XYZ
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
XYZ
,
&
out
[
i
].
XYZ
,
1
);
return
TRUE
;
case
COLOR_RGB
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
XYZ
,
&
out
[
i
].
rgb
,
1
);
goto
done
;
case
COLOR_Lab
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
XYZ
,
&
out
[
i
].
Lab
,
1
);
goto
done
;
case
COLOR_GRAY
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
XYZ
,
&
out
[
i
].
gray
,
1
);
goto
done
;
case
COLOR_CMYK
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
XYZ
,
&
out
[
i
].
cmyk
,
1
);
goto
done
;
case
COLOR_XYZ
:
for
(
i
=
0
;
i
<
count
;
i
++
)
cmsDoTransform
(
xfrm
,
&
in
[
i
].
XYZ
,
&
out
[
i
].
XYZ
,
1
);
goto
done
;
default:
FIXME
(
"unhandled input/output pair: %d/%d
\n
"
,
input_type
,
output_type
);
return
FALSE
;
ret
=
FALSE
;
break
;
}
}
default:
FIXME
(
"unhandled input/output pair: %d/%d
\n
"
,
input_type
,
output_type
);
ret
=
FALSE
;
break
;
}
done:
release_transform
(
transform
);
return
ret
;
#endif
/* HAVE_LCMS */
return
ret
;
return
FALSE
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment