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
8d75d949
Commit
8d75d949
authored
Nov 29, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Fix return values for scaler's CopyPalette().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a05ce6ac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
scaler.c
dlls/windowscodecs/scaler.c
+1
-1
bitmap.c
dlls/windowscodecs/tests/bitmap.c
+16
-0
No files found.
dlls/windowscodecs/scaler.c
View file @
8d75d949
...
...
@@ -163,7 +163,7 @@ static HRESULT WINAPI BitmapScaler_CopyPalette(IWICBitmapScaler *iface,
return
E_INVALIDARG
;
if
(
!
This
->
source
)
return
WINCODEC_ERR_
WRONGSTAT
E
;
return
WINCODEC_ERR_
PALETTEUNAVAILABL
E
;
return
IWICBitmapSource_CopyPalette
(
This
->
source
,
pIPalette
);
}
...
...
dlls/windowscodecs/tests/bitmap.c
View file @
8d75d949
...
...
@@ -1084,6 +1084,7 @@ static void test_bitmap_scaler(void)
{
WICPixelFormatGUID
pixel_format
;
IWICBitmapScaler
*
scaler
;
IWICPalette
*
palette
;
double
res_x
,
res_y
;
IWICBitmap
*
bitmap
;
UINT
width
,
height
;
...
...
@@ -1148,6 +1149,15 @@ static void test_bitmap_scaler(void)
ok
(
width
==
123
,
"Unexpected width %u.
\n
"
,
width
);
ok
(
height
==
321
,
"Unexpected height %u.
\n
"
,
height
);
hr
=
IWICBitmapScaler_CopyPalette
(
scaler
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IWICImagingFactory_CreatePalette
(
factory
,
&
palette
);
ok
(
hr
==
S_OK
,
"Failed to create a palette, hr %#x.
\n
"
,
hr
);
hr
=
IWICBitmapScaler_CopyPalette
(
scaler
,
palette
);
ok
(
hr
==
WINCODEC_ERR_PALETTEUNAVAILABLE
,
"Unexpected hr %#x.
\n
"
,
hr
);
IWICPalette_Release
(
palette
);
hr
=
IWICBitmapScaler_Initialize
(
scaler
,
(
IWICBitmapSource
*
)
bitmap
,
4
,
0
,
WICBitmapInterpolationModeNearestNeighbor
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
@@ -1224,6 +1234,12 @@ static void test_bitmap_scaler(void)
ok
(
hr
==
S_OK
,
"Failed to get scaler resolution, hr %#x.
\n
"
,
hr
);
ok
(
res_x
==
0
.
0
&&
res_y
==
0
.
0
,
"Unexpected resolution %f x %f.
\n
"
,
res_x
,
res_y
);
hr
=
IWICImagingFactory_CreatePalette
(
factory
,
&
palette
);
ok
(
hr
==
S_OK
,
"Failed to create a palette, hr %#x.
\n
"
,
hr
);
hr
=
IWICBitmapScaler_CopyPalette
(
scaler
,
palette
);
ok
(
hr
==
WINCODEC_ERR_PALETTEUNAVAILABLE
,
"Unexpected hr %#x.
\n
"
,
hr
);
IWICPalette_Release
(
palette
);
IWICBitmapScaler_Release
(
scaler
);
IWICBitmap_Release
(
bitmap
);
...
...
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