Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
88f17cdb
Commit
88f17cdb
authored
Jun 13, 2014
by
Vincent Povirk
Committed by
Alexandre Julliard
Jun 16, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Check for empty rect in WriteSource_Proxy.
parent
30f98340
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
6 deletions
+49
-6
main.c
dlls/windowscodecs/main.c
+1
-1
proxy.c
dlls/windowscodecs/proxy.c
+3
-0
converter.c
dlls/windowscodecs/tests/converter.c
+45
-5
No files found.
dlls/windowscodecs/main.c
View file @
88f17cdb
...
...
@@ -182,7 +182,7 @@ HRESULT write_source(IWICBitmapFrameEncode *iface,
prc
=
&
rc
;
}
if
(
prc
->
Width
!=
width
)
if
(
prc
->
Width
!=
width
||
prc
->
Height
<=
0
)
return
E_INVALIDARG
;
stride
=
(
bpp
*
width
+
7
)
/
8
;
...
...
dlls/windowscodecs/proxy.c
View file @
88f17cdb
...
...
@@ -225,6 +225,9 @@ HRESULT WINAPI IWICBitmapFrameEncode_SetThumbnail_Proxy_W(IWICBitmapFrameEncode
HRESULT
WINAPI
IWICBitmapFrameEncode_WriteSource_Proxy_W
(
IWICBitmapFrameEncode
*
iface
,
IWICBitmapSource
*
pIBitmapSource
,
WICRect
*
prc
)
{
if
(
prc
&&
(
prc
->
Width
<=
0
||
prc
->
Height
<=
0
))
prc
=
NULL
;
return
IWICBitmapFrameEncode_WriteSource
(
iface
,
pIBitmapSource
,
prc
);
}
...
...
dlls/windowscodecs/tests/converter.c
View file @
88f17cdb
...
...
@@ -509,7 +509,7 @@ static void test_encoder_properties(const CLSID* clsid_encoder, IPropertyBag2 *o
}
static
void
test_multi_encoder
(
const
struct
bitmap_data
**
srcs
,
const
CLSID
*
clsid_encoder
,
const
struct
bitmap_data
**
dsts
,
const
CLSID
*
clsid_decoder
,
const
char
*
name
)
const
struct
bitmap_data
**
dsts
,
const
CLSID
*
clsid_decoder
,
WICRect
*
rc
,
const
char
*
name
)
{
HRESULT
hr
;
IWICBitmapEncoder
*
encoder
;
...
...
@@ -565,8 +565,14 @@ static void test_multi_encoder(const struct bitmap_data **srcs, const CLSID* cls
hr
=
IWICBitmapFrameEncode_SetSize
(
frameencode
,
srcs
[
i
]
->
width
,
srcs
[
i
]
->
height
);
ok
(
SUCCEEDED
(
hr
),
"SetSize failed, hr=%x
\n
"
,
hr
);
hr
=
IWICBitmapFrameEncode_WriteSource
(
frameencode
,
&
src_obj
->
IWICBitmapSource_iface
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"WriteSource failed, hr=%x
\n
"
,
hr
);
hr
=
IWICBitmapFrameEncode_WriteSource
(
frameencode
,
&
src_obj
->
IWICBitmapSource_iface
,
rc
);
if
(
rc
&&
(
rc
->
Width
<=
0
||
rc
->
Height
<=
0
))
{
/* WriteSource fails but WriteSource_Proxy succeeds. */
ok
(
hr
==
E_INVALIDARG
,
"WriteSource failed, hr=%x (%s)
\n
"
,
hr
,
name
);
hr
=
IWICBitmapFrameEncode_WriteSource_Proxy
(
frameencode
,
&
src_obj
->
IWICBitmapSource_iface
,
rc
);
}
ok
(
SUCCEEDED
(
hr
),
"WriteSource failed, hr=%x (%s)
\n
"
,
hr
,
name
);
hr
=
IWICBitmapFrameEncode_Commit
(
frameencode
);
ok
(
SUCCEEDED
(
hr
),
"Commit failed, hr=%x
\n
"
,
hr
);
...
...
@@ -635,7 +641,39 @@ static void test_encoder(const struct bitmap_data *src, const CLSID* clsid_encod
dsts
[
0
]
=
dst
;
dsts
[
1
]
=
NULL
;
test_multi_encoder
(
srcs
,
clsid_encoder
,
dsts
,
clsid_decoder
,
name
);
test_multi_encoder
(
srcs
,
clsid_encoder
,
dsts
,
clsid_decoder
,
NULL
,
name
);
}
static
void
test_encoder_rects
(
void
)
{
const
struct
bitmap_data
*
srcs
[
2
];
const
struct
bitmap_data
*
dsts
[
2
];
WICRect
rc
;
srcs
[
0
]
=
&
testdata_24bppBGR
;
srcs
[
1
]
=
NULL
;
dsts
[
0
]
=
&
testdata_24bppBGR
;
dsts
[
1
]
=
NULL
;
rc
.
X
=
0
;
rc
.
Y
=
0
;
rc
.
Width
=
4
;
rc
.
Height
=
2
;
test_multi_encoder
(
srcs
,
&
CLSID_WICTiffEncoder
,
dsts
,
&
CLSID_WICTiffDecoder
,
&
rc
,
"test_encoder_rects full"
);
rc
.
Width
=
0
;
test_multi_encoder
(
srcs
,
&
CLSID_WICTiffEncoder
,
dsts
,
&
CLSID_WICTiffDecoder
,
&
rc
,
"test_encoder_rects width=0"
);
rc
.
Width
=
-
1
;
test_multi_encoder
(
srcs
,
&
CLSID_WICTiffEncoder
,
dsts
,
&
CLSID_WICTiffDecoder
,
&
rc
,
"test_encoder_rects width=-1"
);
rc
.
Width
=
4
;
rc
.
Height
=
0
;
test_multi_encoder
(
srcs
,
&
CLSID_WICTiffEncoder
,
dsts
,
&
CLSID_WICTiffDecoder
,
&
rc
,
"test_encoder_rects height=0"
);
rc
.
Height
=
-
1
;
test_multi_encoder
(
srcs
,
&
CLSID_WICTiffEncoder
,
dsts
,
&
CLSID_WICTiffDecoder
,
&
rc
,
"test_encoder_rects height=-1"
);
}
static
const
struct
bitmap_data
*
multiple_frames
[
3
]
=
{
...
...
@@ -673,7 +711,9 @@ START_TEST(converter)
&
testdata_24bppBGR
,
&
CLSID_WICTiffDecoder
,
"TIFF encoder 24bppBGR"
);
test_multi_encoder
(
multiple_frames
,
&
CLSID_WICTiffEncoder
,
multiple_frames
,
&
CLSID_WICTiffDecoder
,
"TIFF encoder multi-frame"
);
multiple_frames
,
&
CLSID_WICTiffDecoder
,
NULL
,
"TIFF encoder multi-frame"
);
test_encoder_rects
();
CoUninitialize
();
}
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