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
02485967
Commit
02485967
authored
Jul 13, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Use calloc() in filter_graph_common_create().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fdb3d9ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
63 deletions
+47
-63
filtergraph.c
dlls/quartz/filtergraph.c
+47
-63
No files found.
dlls/quartz/filtergraph.c
View file @
02485967
...
...
@@ -510,7 +510,7 @@ static ULONG WINAPI FilterGraphInner_Release(IUnknown *iface)
CloseHandle
(
This
->
message_thread_ret
);
}
DeleteCriticalSection
(
&
This
->
cs
);
CoTaskMemF
ree
(
This
);
f
ree
(
This
);
InterlockedDecrement
(
&
object_locks
);
}
...
...
@@ -5377,80 +5377,64 @@ static const IUnknownVtbl IInner_VTable =
static
HRESULT
filter_graph_common_create
(
IUnknown
*
outer
,
IUnknown
**
out
,
BOOL
threaded
)
{
IFilterGraphImpl
*
fimpl
;
IFilterGraphImpl
*
object
;
HRESULT
hr
;
*
out
=
NULL
;
fimpl
=
CoTaskMemAlloc
(
sizeof
(
*
fimpl
));
fimpl
->
defaultclock
=
TRUE
;
fimpl
->
IUnknown_inner
.
lpVtbl
=
&
IInner_VTable
;
fimpl
->
IFilterGraph2_iface
.
lpVtbl
=
&
IFilterGraph2_VTable
;
fimpl
->
IMediaControl_iface
.
lpVtbl
=
&
IMediaControl_VTable
;
fimpl
->
IMediaSeeking_iface
.
lpVtbl
=
&
IMediaSeeking_VTable
;
fimpl
->
IBasicAudio_iface
.
lpVtbl
=
&
IBasicAudio_VTable
;
fimpl
->
IBasicVideo2_iface
.
lpVtbl
=
&
IBasicVideo_VTable
;
fimpl
->
IVideoWindow_iface
.
lpVtbl
=
&
IVideoWindow_VTable
;
fimpl
->
IMediaEventEx_iface
.
lpVtbl
=
&
IMediaEventEx_VTable
;
fimpl
->
IMediaFilter_iface
.
lpVtbl
=
&
IMediaFilter_VTable
;
fimpl
->
IMediaEventSink_iface
.
lpVtbl
=
&
IMediaEventSink_VTable
;
fimpl
->
IGraphConfig_iface
.
lpVtbl
=
&
IGraphConfig_VTable
;
fimpl
->
IMediaPosition_iface
.
lpVtbl
=
&
IMediaPosition_VTable
;
fimpl
->
IObjectWithSite_iface
.
lpVtbl
=
&
IObjectWithSite_VTable
;
fimpl
->
IGraphVersion_iface
.
lpVtbl
=
&
IGraphVersion_VTable
;
fimpl
->
IVideoFrameStep_iface
.
lpVtbl
=
&
VideoFrameStep_vtbl
;
fimpl
->
ref
=
1
;
list_init
(
&
fimpl
->
filters
);
fimpl
->
name_index
=
1
;
fimpl
->
refClock
=
NULL
;
fimpl
->
hEventCompletion
=
CreateEventW
(
0
,
TRUE
,
FALSE
,
0
);
fimpl
->
HandleEcComplete
=
TRUE
;
fimpl
->
HandleEcRepaint
=
TRUE
;
fimpl
->
HandleEcClockChanged
=
TRUE
;
fimpl
->
notif
.
hWnd
=
0
;
fimpl
->
notif
.
disabled
=
FALSE
;
fimpl
->
nRenderers
=
0
;
fimpl
->
EcCompleteCount
=
0
;
fimpl
->
refClockProvider
=
NULL
;
fimpl
->
state
=
State_Stopped
;
fimpl
->
pSite
=
NULL
;
EventsQueue_Init
(
&
fimpl
->
evqueue
);
InitializeCriticalSection
(
&
fimpl
->
cs
);
fimpl
->
cs
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": IFilterGraphImpl.cs"
);
fimpl
->
nItfCacheEntries
=
0
;
memcpy
(
&
fimpl
->
timeformatseek
,
&
TIME_FORMAT_MEDIA_TIME
,
sizeof
(
GUID
));
fimpl
->
stream_start
=
fimpl
->
stream_elapsed
=
0
;
fimpl
->
punkFilterMapper2
=
NULL
;
fimpl
->
version
=
0
;
fimpl
->
current_pos
=
0
;
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
threaded
)
object
->
IBasicAudio_iface
.
lpVtbl
=
&
IBasicAudio_VTable
;
object
->
IBasicVideo2_iface
.
lpVtbl
=
&
IBasicVideo_VTable
;
object
->
IFilterGraph2_iface
.
lpVtbl
=
&
IFilterGraph2_VTable
;
object
->
IGraphConfig_iface
.
lpVtbl
=
&
IGraphConfig_VTable
;
object
->
IGraphVersion_iface
.
lpVtbl
=
&
IGraphVersion_VTable
;
object
->
IMediaControl_iface
.
lpVtbl
=
&
IMediaControl_VTable
;
object
->
IMediaEventEx_iface
.
lpVtbl
=
&
IMediaEventEx_VTable
;
object
->
IMediaEventSink_iface
.
lpVtbl
=
&
IMediaEventSink_VTable
;
object
->
IMediaFilter_iface
.
lpVtbl
=
&
IMediaFilter_VTable
;
object
->
IMediaPosition_iface
.
lpVtbl
=
&
IMediaPosition_VTable
;
object
->
IMediaSeeking_iface
.
lpVtbl
=
&
IMediaSeeking_VTable
;
object
->
IObjectWithSite_iface
.
lpVtbl
=
&
IObjectWithSite_VTable
;
object
->
IUnknown_inner
.
lpVtbl
=
&
IInner_VTable
;
object
->
IVideoFrameStep_iface
.
lpVtbl
=
&
VideoFrameStep_vtbl
;
object
->
IVideoWindow_iface
.
lpVtbl
=
&
IVideoWindow_VTable
;
object
->
ref
=
1
;
object
->
outer_unk
=
outer
?
outer
:
&
object
->
IUnknown_inner
;
if
(
FAILED
(
hr
=
CoCreateInstance
(
&
CLSID_FilterMapper2
,
object
->
outer_unk
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
object
->
punkFilterMapper2
)))
{
fimpl
->
message_thread_ret
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
f
impl
->
message_thread
=
CreateThread
(
NULL
,
0
,
message_thread_run
,
fimpl
,
0
,
&
fimpl
->
message_thread_id
);
WaitForSingleObject
(
fimpl
->
message_thread_ret
,
INFINITE
)
;
ERR
(
"Failed to create filter mapper, hr %#x.
\n
"
,
hr
);
f
ree
(
object
);
return
hr
;
}
else
fimpl
->
message_thread
=
NULL
;
fimpl
->
outer_unk
=
outer
?
outer
:
&
fimpl
->
IUnknown_inner
;
InitializeCriticalSection
(
&
object
->
cs
);
object
->
cs
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": IFilterGraphImpl.cs"
);
/* create Filtermapper aggregated. */
hr
=
CoCreateInstance
(
&
CLSID_FilterMapper2
,
fimpl
->
outer_unk
,
CLSCTX_INPROC_SERVER
,
&
IID_IUnknown
,
(
void
**
)
&
fimpl
->
punkFilterMapper2
);
object
->
defaultclock
=
TRUE
;
EventsQueue_Init
(
&
object
->
evqueue
);
list_init
(
&
object
->
filters
);
object
->
HandleEcClockChanged
=
TRUE
;
object
->
HandleEcComplete
=
TRUE
;
object
->
HandleEcRepaint
=
TRUE
;
object
->
hEventCompletion
=
CreateEventW
(
0
,
TRUE
,
FALSE
,
0
);
object
->
name_index
=
1
;
object
->
timeformatseek
=
TIME_FORMAT_MEDIA_TIME
;
if
(
FAILED
(
hr
))
{
ERR
(
"Unable to create filter mapper (%x)
\n
"
,
hr
);
if
(
fimpl
->
punkFilterMapper2
)
IUnknown_Release
(
fimpl
->
punkFilterMapper2
);
CloseHandle
(
fimpl
->
hEventCompletion
);
EventsQueue_Destroy
(
&
fimpl
->
evqueue
);
fimpl
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
fimpl
->
cs
);
CoTaskMemFree
(
fimpl
);
return
hr
;
if
(
threaded
)
{
object
->
message_thread_ret
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
object
->
message_thread
=
CreateThread
(
NULL
,
0
,
message_thread_run
,
object
,
0
,
&
object
->
message_thread_id
);
WaitForSingleObject
(
object
->
message_thread_ret
,
INFINITE
);
}
else
object
->
message_thread
=
NULL
;
*
out
=
&
fimpl
->
IUnknown_inner
;
TRACE
(
"Created %sthreaded filter graph %p.
\n
"
,
threaded
?
""
:
"non-"
,
object
);
*
out
=
&
object
->
IUnknown_inner
;
return
S_OK
;
}
...
...
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