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
18e76792
Commit
18e76792
authored
Mar 08, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Fix handling of a tRNS PNG chunk in the frame CopyPalette method.
parent
37b33a9d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
13 deletions
+6
-13
pngformat.c
dlls/windowscodecs/pngformat.c
+6
-11
pngformat.c
dlls/windowscodecs/tests/pngformat.c
+0
-2
No files found.
dlls/windowscodecs/pngformat.c
View file @
18e76792
...
...
@@ -798,7 +798,7 @@ static HRESULT WINAPI PngDecoder_Frame_CopyPalette(IWICBitmapFrameDecode *iface,
png_colorp
png_palette
;
int
num_palette
;
WICColor
palette
[
256
];
png_bytep
trans
;
png_bytep
trans
_alpha
;
int
num_trans
;
png_color_16p
trans_values
;
int
i
;
...
...
@@ -822,23 +822,18 @@ static HRESULT WINAPI PngDecoder_Frame_CopyPalette(IWICBitmapFrameDecode *iface,
goto
end
;
}
ret
=
ppng_get_tRNS
(
This
->
png_ptr
,
This
->
info_ptr
,
&
trans_alpha
,
&
num_trans
,
&
trans_values
);
if
(
!
ret
)
num_trans
=
0
;
for
(
i
=
0
;
i
<
num_palette
;
i
++
)
{
palette
[
i
]
=
(
0xff000000
|
BYTE
alpha
=
(
i
<
num_trans
)
?
trans_alpha
[
i
]
:
0xff
;
palette
[
i
]
=
(
alpha
<<
24
|
png_palette
[
i
].
red
<<
16
|
png_palette
[
i
].
green
<<
8
|
png_palette
[
i
].
blue
);
}
ret
=
ppng_get_tRNS
(
This
->
png_ptr
,
This
->
info_ptr
,
&
trans
,
&
num_trans
,
&
trans_values
);
if
(
ret
)
{
for
(
i
=
0
;
i
<
num_trans
;
i
++
)
{
palette
[
trans
[
i
]]
=
0x00000000
;
}
}
end:
LeaveCriticalSection
(
&
This
->
lock
);
...
...
dlls/windowscodecs/tests/pngformat.c
View file @
18e76792
...
...
@@ -577,9 +577,7 @@ static void test_png_palette(void)
hr
=
IWICPalette_GetColors
(
palette
,
256
,
color
,
&
ret
);
ok
(
hr
==
S_OK
,
"GetColors error %#x
\n
"
,
hr
);
ok
(
ret
==
count
,
"expected %u, got %u
\n
"
,
count
,
ret
);
todo_wine
ok
(
color
[
0
]
==
0xff010203
,
"expected 0xff010203, got %#x
\n
"
,
color
[
0
]);
todo_wine
ok
(
color
[
1
]
==
0x00040506
,
"expected 0x00040506, got %#x
\n
"
,
color
[
1
]);
IWICPalette_Release
(
palette
);
...
...
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