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
dddd5a5f
Commit
dddd5a5f
authored
Jun 08, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat/buffer: Fix maximum length for YV12 format.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4f961d9e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
buffer.c
dlls/mfplat/buffer.c
+1
-0
mfplat.c
dlls/mfplat/tests/mfplat.c
+16
-8
No files found.
dlls/mfplat/buffer.c
View file @
dddd5a5f
...
...
@@ -1357,6 +1357,7 @@ static HRESULT create_2d_buffer(DWORD width, DWORD height, DWORD fourcc, BOOL bo
plane_size
*=
2
;
break
;
case
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'2'
):
case
MAKEFOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
):
case
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'2'
):
case
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'4'
):
max_length
=
pitch
*
height
*
3
/
2
;
...
...
dlls/mfplat/tests/mfplat.c
View file @
dddd5a5f
...
...
@@ -5450,14 +5450,16 @@ static void test_MFCreate2DMediaBuffer(void)
unsigned
int
contiguous_length
;
int
pitch
;
unsigned
int
plane_multiplier
;
unsigned
int
max_length
;
}
_2d_buffer_tests
[]
=
{
{
2
,
2
,
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'2'
),
6
,
64
},
{
2
,
2
,
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'2'
),
6
,
64
,
0
,
192
},
{
4
,
2
,
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'2'
),
12
,
64
},
{
2
,
4
,
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'2'
),
12
,
64
},
{
1
,
3
,
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'2'
),
4
,
64
},
{
4
,
16
,
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'2'
),
96
,
64
,
0
,
1536
},
{
2
,
2
,
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'2'
),
6
,
128
},
{
2
,
2
,
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'2'
),
6
,
128
,
0
,
384
},
{
4
,
2
,
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'2'
),
12
,
128
},
{
2
,
4
,
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'2'
),
12
,
128
},
{
2
,
2
,
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'4'
),
6
,
128
},
...
...
@@ -5466,29 +5468,29 @@ static void test_MFCreate2DMediaBuffer(void)
{
4
,
2
,
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'1'
),
32
,
128
,
2
},
{
4
,
4
,
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'1'
),
64
,
128
,
2
},
{
4
,
16
,
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'1'
),
256
,
128
,
2
},
{
4
,
16
,
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'1'
),
256
,
128
,
2
,
4096
},
{
4
,
20
,
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'1'
),
320
,
128
,
2
},
{
4
,
2
,
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'3'
),
32
,
128
,
2
},
{
4
,
4
,
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'3'
),
64
,
128
,
2
},
{
4
,
16
,
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'3'
),
256
,
128
,
2
},
{
4
,
16
,
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'3'
),
256
,
128
,
2
,
4096
},
{
4
,
20
,
MAKEFOURCC
(
'I'
,
'M'
,
'C'
,
'3'
),
320
,
128
,
2
},
{
4
,
2
,
MAKEFOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
),
12
,
128
},
{
4
,
4
,
MAKEFOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
),
24
,
128
},
{
4
,
16
,
MAKEFOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
),
96
,
128
},
{
4
,
16
,
MAKEFOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
),
96
,
128
,
0
,
3072
},
{
4
,
2
,
MAKEFOURCC
(
'A'
,
'Y'
,
'U'
,
'V'
),
32
,
64
},
{
4
,
4
,
MAKEFOURCC
(
'A'
,
'Y'
,
'U'
,
'V'
),
64
,
64
},
{
4
,
16
,
MAKEFOURCC
(
'A'
,
'Y'
,
'U'
,
'V'
),
256
,
64
},
{
4
,
16
,
MAKEFOURCC
(
'A'
,
'Y'
,
'U'
,
'V'
),
256
,
64
,
0
,
1024
},
{
4
,
2
,
MAKEFOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
),
16
,
64
},
{
4
,
4
,
MAKEFOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
),
32
,
64
},
{
4
,
16
,
MAKEFOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
),
128
,
64
},
{
4
,
16
,
MAKEFOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
),
128
,
64
,
0
,
1024
},
{
4
,
2
,
MAKEFOURCC
(
'U'
,
'Y'
,
'V'
,
'Y'
),
16
,
64
},
{
4
,
4
,
MAKEFOURCC
(
'U'
,
'Y'
,
'V'
,
'Y'
),
32
,
64
},
{
4
,
16
,
MAKEFOURCC
(
'U'
,
'Y'
,
'V'
,
'Y'
),
128
,
64
},
{
4
,
16
,
MAKEFOURCC
(
'U'
,
'Y'
,
'V'
,
'Y'
),
128
,
64
,
0
,
1024
},
{
2
,
4
,
D3DFMT_A8R8G8B8
,
32
,
64
},
{
1
,
4
,
D3DFMT_A8R8G8B8
,
16
,
64
},
...
...
@@ -5681,6 +5683,12 @@ static void test_MFCreate2DMediaBuffer(void)
hr
=
pMFCreate2DMediaBuffer
(
ptr
->
width
,
ptr
->
height
,
ptr
->
fourcc
,
FALSE
,
&
buffer
);
ok
(
hr
==
S_OK
,
"Failed to create a buffer, hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaBuffer_GetMaxLength
(
buffer
,
&
length
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
if
(
ptr
->
max_length
)
ok
(
length
==
ptr
->
max_length
,
"%u: unexpected maximum length %u for %u x %u, format %s.
\n
"
,
i
,
length
,
ptr
->
width
,
ptr
->
height
,
wine_dbgstr_an
((
char
*
)
&
ptr
->
fourcc
,
4
));
hr
=
IMFMediaBuffer_QueryInterface
(
buffer
,
&
IID_IMF2DBuffer
,
(
void
**
)
&
_2dbuffer
);
ok
(
hr
==
S_OK
,
"Failed to get interface, 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