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
b5040bce
Commit
b5040bce
authored
Aug 16, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfreadwrite/writer: Make sure output pointer is initialized.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
debf5d85
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
mfplat.c
dlls/mfreadwrite/tests/mfplat.c
+10
-0
writer.c
dlls/mfreadwrite/writer.c
+13
-0
No files found.
dlls/mfreadwrite/tests/mfplat.c
View file @
b5040bce
...
...
@@ -1299,8 +1299,18 @@ static void test_sink_writer(void)
hr
=
MFCreateSinkWriterFromURL
(
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
writer
=
(
void
*
)
0xdeadbeef
;
hr
=
MFCreateSinkWriterFromURL
(
NULL
,
NULL
,
NULL
,
&
writer
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
writer
,
"Unexpected pointer %p.
\n
"
,
writer
);
hr
=
MFCreateSinkWriterFromMediaSink
(
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
writer
=
(
void
*
)
0xdeadbeef
;
hr
=
MFCreateSinkWriterFromMediaSink
(
NULL
,
NULL
,
&
writer
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
writer
,
"Unexpected pointer %p.
\n
"
,
writer
);
}
START_TEST
(
mfplat
)
...
...
dlls/mfreadwrite/writer.c
View file @
b5040bce
...
...
@@ -186,6 +186,11 @@ HRESULT create_sink_writer_from_sink(IMFMediaSink *sink, IMFAttributes *attribut
struct
sink_writer
*
object
;
HRESULT
hr
;
*
out
=
NULL
;
if
(
!
sink
)
return
E_INVALIDARG
;
object
=
malloc
(
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
...
...
@@ -205,6 +210,9 @@ HRESULT WINAPI MFCreateSinkWriterFromMediaSink(IMFMediaSink *sink, IMFAttributes
{
TRACE
(
"%p, %p, %p.
\n
"
,
sink
,
attributes
,
writer
);
if
(
!
writer
)
return
E_INVALIDARG
;
return
create_sink_writer_from_sink
(
sink
,
attributes
,
&
IID_IMFSinkWriter
,
(
void
**
)
writer
);
}
...
...
@@ -289,6 +297,8 @@ HRESULT create_sink_writer_from_url(const WCHAR *url, IMFByteStream *bytestream,
CLSID
clsid
;
HRESULT
hr
;
*
out
=
NULL
;
if
(
!
url
&&
!
bytestream
)
return
E_INVALIDARG
;
...
...
@@ -332,5 +342,8 @@ HRESULT WINAPI MFCreateSinkWriterFromURL(const WCHAR *url, IMFByteStream *bytest
{
TRACE
(
"%s, %p, %p, %p.
\n
"
,
debugstr_w
(
url
),
bytestream
,
attributes
,
writer
);
if
(
!
writer
)
return
E_INVALIDARG
;
return
create_sink_writer_from_url
(
url
,
bytestream
,
attributes
,
&
IID_IMFSinkWriter
,
(
void
**
)
writer
);
}
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