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
a419b3eb
Commit
a419b3eb
authored
Oct 05, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/presenter: Better validate input rectangles in SetVideoPosition().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6019f3c1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
presenter.c
dlls/evr/presenter.c
+9
-1
evr.c
dlls/evr/tests/evr.c
+24
-0
No files found.
dlls/evr/presenter.c
View file @
a419b3eb
...
...
@@ -510,7 +510,15 @@ static HRESULT WINAPI video_presenter_control_SetVideoPosition(IMFVideoDisplayCo
return
E_POINTER
;
if
(
src_rect
&&
(
src_rect
->
left
<
0
.
0
f
||
src_rect
->
top
<
0
.
0
f
||
src_rect
->
right
>
1
.
0
f
||
src_rect
->
bottom
>
1
.
0
f
))
src_rect
->
right
>
1
.
0
f
||
src_rect
->
bottom
>
1
.
0
f
||
src_rect
->
left
>
src_rect
->
right
||
src_rect
->
top
>
src_rect
->
bottom
))
{
return
E_INVALIDARG
;
}
if
(
dst_rect
&&
(
dst_rect
->
left
>
dst_rect
->
right
||
dst_rect
->
top
>
dst_rect
->
bottom
))
return
E_INVALIDARG
;
EnterCriticalSection
(
&
presenter
->
cs
);
...
...
dlls/evr/tests/evr.c
View file @
a419b3eb
...
...
@@ -1111,6 +1111,21 @@ static void test_default_presenter(void)
hr
=
IMFVideoDisplayControl_SetVideoPosition
(
display_control
,
&
src_rect
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
/* Flipped source rectangle. */
src_rect
.
left
=
0
.
5
f
;
src_rect
.
top
=
0
.
0
f
;
src_rect
.
right
=
0
.
4
f
;
src_rect
.
bottom
=
1
.
0
f
;
hr
=
IMFVideoDisplayControl_SetVideoPosition
(
display_control
,
&
src_rect
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
src_rect
.
left
=
0
.
0
f
;
src_rect
.
top
=
0
.
5
f
;
src_rect
.
right
=
0
.
4
f
;
src_rect
.
bottom
=
0
.
1
f
;
hr
=
IMFVideoDisplayControl_SetVideoPosition
(
display_control
,
&
src_rect
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
src_rect
.
left
=
0
.
1
f
;
src_rect
.
top
=
0
.
2
f
;
src_rect
.
right
=
0
.
8
f
;
...
...
@@ -1123,6 +1138,15 @@ static void test_default_presenter(void)
ok
(
src_rect
.
left
==
0
.
1
f
&&
src_rect
.
top
==
0
.
2
f
&&
src_rect
.
right
==
0
.
8
f
&&
src_rect
.
bottom
==
0
.
9
f
,
"Unexpected source rectangle.
\n
"
);
/* Flipped destination rectangle. */
SetRect
(
&
dst_rect
,
100
,
1
,
50
,
1000
);
hr
=
IMFVideoDisplayControl_SetVideoPosition
(
display_control
,
NULL
,
&
dst_rect
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
SetRect
(
&
dst_rect
,
1
,
100
,
100
,
50
);
hr
=
IMFVideoDisplayControl_SetVideoPosition
(
display_control
,
NULL
,
&
dst_rect
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
SetRect
(
&
dst_rect
,
1
,
2
,
999
,
1000
);
hr
=
IMFVideoDisplayControl_SetVideoPosition
(
display_control
,
NULL
,
&
dst_rect
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
...
...
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