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
bab4f293
Commit
bab4f293
authored
Jun 17, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Use CRT allocation functions.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
569f1ac0
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
93 additions
and
138 deletions
+93
-138
clock.c
dlls/mf/clock.c
+11
-15
copier.c
dlls/mf/copier.c
+2
-4
evr.c
dlls/mf/evr.c
+9
-9
main.c
dlls/mf/main.c
+17
-40
mf_private.h
dlls/mf/mf_private.h
+1
-2
samplegrabber.c
dlls/mf/samplegrabber.c
+7
-10
sar.c
dlls/mf/sar.c
+5
-6
session.c
dlls/mf/session.c
+29
-32
topology.c
dlls/mf/topology.c
+12
-20
No files found.
dlls/mf/clock.c
View file @
bab4f293
...
...
@@ -19,7 +19,6 @@
#define COBJMACROS
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
#include "mf_private.h"
...
...
@@ -174,7 +173,7 @@ static ULONG WINAPI sink_notification_Release(IUnknown *iface)
if
(
!
refcount
)
{
IMFClockStateSink_Release
(
notification
->
sink
);
heap_
free
(
notification
);
free
(
notification
);
}
return
refcount
;
...
...
@@ -194,8 +193,7 @@ static void clock_notify_async_sink(struct presentation_clock *clock, MFTIME sys
IMFAsyncResult
*
result
;
HRESULT
hr
;
object
=
heap_alloc
(
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
(
object
=
malloc
(
sizeof
(
*
object
))))
return
;
object
->
IUnknown_iface
.
lpVtbl
=
&
sinknotificationvtbl
;
...
...
@@ -279,7 +277,7 @@ static ULONG WINAPI present_clock_Release(IMFPresentationClock *iface)
{
list_remove
(
&
sink
->
entry
);
IMFClockStateSink_Release
(
sink
->
state_sink
);
heap_
free
(
sink
);
free
(
sink
);
}
LIST_FOR_EACH_ENTRY_SAFE
(
timer
,
timer2
,
&
clock
->
timers
,
struct
clock_timer
,
entry
)
{
...
...
@@ -287,7 +285,7 @@ static ULONG WINAPI present_clock_Release(IMFPresentationClock *iface)
IUnknown_Release
(
&
timer
->
IUnknown_iface
);
}
DeleteCriticalSection
(
&
clock
->
cs
);
heap_
free
(
clock
);
free
(
clock
);
}
return
refcount
;
...
...
@@ -456,8 +454,7 @@ static HRESULT WINAPI present_clock_AddClockStateSink(IMFPresentationClock *ifac
if
(
!
state_sink
)
return
E_INVALIDARG
;
sink
=
heap_alloc
(
sizeof
(
*
sink
));
if
(
!
sink
)
if
(
!
(
sink
=
malloc
(
sizeof
(
*
sink
))))
return
E_OUTOFMEMORY
;
sink
->
state_sink
=
state_sink
;
...
...
@@ -496,7 +493,7 @@ static HRESULT WINAPI present_clock_AddClockStateSink(IMFPresentationClock *ifac
if
(
FAILED
(
hr
))
{
IMFClockStateSink_Release
(
sink
->
state_sink
);
heap_
free
(
sink
);
free
(
sink
);
}
return
hr
;
...
...
@@ -520,7 +517,7 @@ static HRESULT WINAPI present_clock_RemoveClockStateSink(IMFPresentationClock *i
{
IMFClockStateSink_Release
(
sink
->
state_sink
);
list_remove
(
&
sink
->
entry
);
heap_
free
(
sink
);
free
(
sink
);
break
;
}
}
...
...
@@ -868,7 +865,7 @@ static ULONG WINAPI clock_timer_Release(IUnknown *iface)
{
IMFAsyncResult_Release
(
timer
->
result
);
IMFAsyncCallback_Release
(
timer
->
callback
);
heap_
free
(
timer
);
free
(
timer
);
}
return
refcount
;
...
...
@@ -890,12 +887,12 @@ static HRESULT WINAPI present_clock_timer_SetTimer(IMFTimer *iface, DWORD flags,
TRACE
(
"%p, %#x, %s, %p, %p, %p.
\n
"
,
iface
,
flags
,
debugstr_time
(
time
),
callback
,
state
,
cancel_key
);
if
(
!
(
clock_timer
=
heap_alloc_zero
(
sizeof
(
*
clock_timer
))))
if
(
!
(
clock_timer
=
calloc
(
1
,
sizeof
(
*
clock_timer
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
MFCreateAsyncResult
(
NULL
,
NULL
,
state
,
&
clock_timer
->
result
)))
{
heap_
free
(
clock_timer
);
free
(
clock_timer
);
return
hr
;
}
...
...
@@ -1140,8 +1137,7 @@ HRESULT WINAPI MFCreatePresentationClock(IMFPresentationClock **clock)
TRACE
(
"%p.
\n
"
,
clock
);
object
=
heap_alloc_zero
(
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IMFPresentationClock_iface
.
lpVtbl
=
&
presentationclockvtbl
;
...
...
dlls/mf/copier.c
View file @
bab4f293
...
...
@@ -23,7 +23,6 @@
#include "mf_private.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
mfplat
);
...
...
@@ -92,7 +91,7 @@ static ULONG WINAPI sample_copier_transform_Release(IMFTransform *iface)
if
(
transform
->
buffer_type
)
IMFMediaType_Release
(
transform
->
buffer_type
);
DeleteCriticalSection
(
&
transform
->
cs
);
heap_
free
(
transform
);
free
(
transform
);
}
return
refcount
;
...
...
@@ -576,8 +575,7 @@ HRESULT WINAPI MFCreateSampleCopierMFT(IMFTransform **transform)
TRACE
(
"%p.
\n
"
,
transform
);
object
=
heap_alloc_zero
(
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IMFTransform_iface
.
lpVtbl
=
&
sample_copier_transform_vtbl
;
...
...
dlls/mf/evr.c
View file @
bab4f293
...
...
@@ -286,7 +286,7 @@ static ULONG WINAPI video_stream_sink_Release(IMFStreamSink *iface)
if
(
stream
->
allocator
)
IMFVideoSampleAllocator_Release
(
stream
->
allocator
);
DeleteCriticalSection
(
&
stream
->
cs
);
heap_
free
(
stream
);
free
(
stream
);
}
return
refcount
;
...
...
@@ -1053,7 +1053,7 @@ static HRESULT video_renderer_stream_create(struct video_renderer *renderer, uns
unsigned
int
value
;
HRESULT
hr
;
if
(
!
(
stream
=
heap_alloc_zero
(
sizeof
(
*
stream
))))
if
(
!
(
stream
=
calloc
(
1
,
sizeof
(
*
stream
))))
return
E_OUTOFMEMORY
;
stream
->
IMFStreamSink_iface
.
lpVtbl
=
&
video_stream_sink_vtbl
;
...
...
@@ -1179,7 +1179,7 @@ static ULONG WINAPI video_renderer_sink_Release(IMFMediaSink *iface)
if
(
renderer
->
attributes
)
IMFAttributes_Release
(
renderer
->
attributes
);
DeleteCriticalSection
(
&
renderer
->
cs
);
heap_
free
(
renderer
);
free
(
renderer
);
}
return
refcount
;
...
...
@@ -1456,7 +1456,7 @@ static HRESULT WINAPI video_renderer_sink_Shutdown(IMFMediaSink *iface)
IMFMediaSink_Release
(
iface
);
renderer
->
streams
[
i
]
=
NULL
;
}
heap_
free
(
renderer
->
streams
);
free
(
renderer
->
streams
);
renderer
->
stream_count
=
0
;
renderer
->
stream_size
=
0
;
IMFMediaEventQueue_Shutdown
(
renderer
->
event_queue
);
...
...
@@ -1637,8 +1637,8 @@ static HRESULT video_renderer_configure_mixer(struct video_renderer *renderer)
/* Create stream sinks for inputs that mixer already has by default. */
if
(
SUCCEEDED
(
IMFTransform_GetStreamCount
(
renderer
->
mixer
,
&
input_count
,
&
output_count
)))
{
ids
=
heap_
calloc
(
input_count
,
sizeof
(
*
ids
));
oids
=
heap_
calloc
(
output_count
,
sizeof
(
*
oids
));
ids
=
calloc
(
input_count
,
sizeof
(
*
ids
));
oids
=
calloc
(
output_count
,
sizeof
(
*
oids
));
if
(
ids
&&
oids
)
{
...
...
@@ -1652,8 +1652,8 @@ static HRESULT video_renderer_configure_mixer(struct video_renderer *renderer)
}
heap_
free
(
ids
);
heap_
free
(
oids
);
free
(
ids
);
free
(
oids
);
}
}
...
...
@@ -2766,7 +2766,7 @@ static HRESULT evr_create_object(IMFAttributes *attributes, void *user_context,
TRACE
(
"%p, %p, %p.
\n
"
,
attributes
,
user_context
,
obj
);
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IMFMediaSink_iface
.
lpVtbl
=
&
video_renderer_sink_vtbl
;
...
...
dlls/mf/main.c
View file @
bab4f293
...
...
@@ -29,7 +29,6 @@
#include "mf_private.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
mfplat
);
...
...
@@ -93,7 +92,7 @@ static ULONG WINAPI activate_object_Release(IMFActivate *iface)
if
(
activate
->
object
)
IUnknown_Release
(
activate
->
object
);
IMFAttributes_Release
(
activate
->
attributes
);
heap_
free
(
activate
);
free
(
activate
);
}
return
refcount
;
...
...
@@ -461,15 +460,14 @@ HRESULT create_activation_object(void *context, const struct activate_funcs *fun
struct
activate_object
*
object
;
HRESULT
hr
;
object
=
heap_alloc_zero
(
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IMFActivate_iface
.
lpVtbl
=
&
activate_object_vtbl
;
object
->
refcount
=
1
;
if
(
FAILED
(
hr
=
MFCreateAttributes
(
&
object
->
attributes
,
0
)))
{
heap_
free
(
object
);
free
(
object
);
return
hr
;
}
object
->
funcs
=
funcs
;
...
...
@@ -620,12 +618,12 @@ static ULONG WINAPI file_scheme_handler_Release(IMFSchemeHandler *iface)
IMFAsyncResult_Release
(
result
->
result
);
if
(
result
->
object
)
IUnknown_Release
(
result
->
object
);
heap_
free
(
result
);
free
(
result
);
}
DeleteCriticalSection
(
&
handler
->
cs
);
if
(
handler
->
resolver
)
IMFSourceResolver_Release
(
handler
->
resolver
);
heap_
free
(
handler
);
free
(
handler
);
}
return
refcount
;
...
...
@@ -683,8 +681,8 @@ static ULONG WINAPI create_object_context_Release(IUnknown *iface)
{
if
(
context
->
props
)
IPropertyStore_Release
(
context
->
props
);
heap_
free
(
context
->
url
);
heap_
free
(
context
);
free
(
context
->
url
);
free
(
context
);
}
return
refcount
;
...
...
@@ -697,23 +695,6 @@ static const IUnknownVtbl create_object_context_vtbl =
create_object_context_Release
,
};
static
WCHAR
*
heap_strdupW
(
const
WCHAR
*
str
)
{
WCHAR
*
ret
=
NULL
;
if
(
str
)
{
unsigned
int
size
;
size
=
(
lstrlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
);
ret
=
heap_alloc
(
size
);
if
(
ret
)
memcpy
(
ret
,
str
,
size
);
}
return
ret
;
}
static
HRESULT
WINAPI
file_scheme_handler_BeginCreateObject
(
IMFSchemeHandler
*
iface
,
const
WCHAR
*
url
,
DWORD
flags
,
IPropertyStore
*
props
,
IUnknown
**
cancel_cookie
,
IMFAsyncCallback
*
callback
,
IUnknown
*
state
)
{
...
...
@@ -730,8 +711,7 @@ static HRESULT WINAPI file_scheme_handler_BeginCreateObject(IMFSchemeHandler *if
if
(
FAILED
(
hr
=
MFCreateAsyncResult
(
NULL
,
callback
,
state
,
&
caller
)))
return
hr
;
context
=
heap_alloc
(
sizeof
(
*
context
));
if
(
!
context
)
if
(
!
(
context
=
malloc
(
sizeof
(
*
context
))))
{
IMFAsyncResult_Release
(
caller
);
return
E_OUTOFMEMORY
;
...
...
@@ -743,7 +723,7 @@ static HRESULT WINAPI file_scheme_handler_BeginCreateObject(IMFSchemeHandler *if
if
(
context
->
props
)
IPropertyStore_AddRef
(
context
->
props
);
context
->
flags
=
flags
;
context
->
url
=
heap_strdupW
(
url
);
context
->
url
=
wcsdup
(
url
);
if
(
!
context
->
url
)
{
IMFAsyncResult_Release
(
caller
);
...
...
@@ -800,7 +780,7 @@ static HRESULT WINAPI file_scheme_handler_EndCreateObject(IMFSchemeHandler *ifac
*
object
=
found
->
object
;
hr
=
IMFAsyncResult_GetStatus
(
found
->
result
);
IMFAsyncResult_Release
(
found
->
result
);
heap_
free
(
found
);
free
(
found
);
}
else
{
...
...
@@ -838,7 +818,7 @@ static HRESULT WINAPI file_scheme_handler_CancelObjectCreation(IMFSchemeHandler
IMFAsyncResult_Release
(
found
->
result
);
if
(
found
->
object
)
IUnknown_Release
(
found
->
object
);
heap_
free
(
found
);
free
(
found
);
}
return
found
?
S_OK
:
MF_E_UNEXPECTED
;
...
...
@@ -957,7 +937,7 @@ static HRESULT WINAPI file_scheme_handler_callback_Invoke(IMFAsyncCallback *ifac
}
}
handler_result
=
heap_
alloc
(
sizeof
(
*
handler_result
));
handler_result
=
m
alloc
(
sizeof
(
*
handler_result
));
if
(
handler_result
)
{
handler_result
->
result
=
caller
;
...
...
@@ -1000,8 +980,7 @@ static HRESULT file_scheme_handler_construct(REFIID riid, void **obj)
TRACE
(
"%s, %p.
\n
"
,
debugstr_guid
(
riid
),
obj
);
handler
=
heap_alloc_zero
(
sizeof
(
*
handler
));
if
(
!
handler
)
if
(
!
(
handler
=
calloc
(
1
,
sizeof
(
*
handler
))))
return
E_OUTOFMEMORY
;
handler
->
IMFSchemeHandler_iface
.
lpVtbl
=
&
file_scheme_handler_vtbl
;
...
...
@@ -1098,8 +1077,7 @@ static HRESULT mf_get_handler_strings(const WCHAR *path, WCHAR filter, unsigned
int
i
,
index
;
WCHAR
*
buffW
;
buffW
=
heap_calloc
(
maxlen
,
sizeof
(
*
buffW
));
if
(
!
buffW
)
if
(
!
(
buffW
=
calloc
(
maxlen
,
sizeof
(
*
buffW
))))
return
E_OUTOFMEMORY
;
memset
(
dst
,
0
,
sizeof
(
*
dst
));
...
...
@@ -1135,7 +1113,7 @@ static HRESULT mf_get_handler_strings(const WCHAR *path, WCHAR filter, unsigned
if
(
FAILED
(
hr
))
PropVariantClear
(
dst
);
heap_
free
(
buffW
);
free
(
buffW
);
return
hr
;
}
...
...
@@ -1276,7 +1254,7 @@ static ULONG WINAPI simple_type_handler_Release(IMFMediaTypeHandler *iface)
if
(
handler
->
media_type
)
IMFMediaType_Release
(
handler
->
media_type
);
DeleteCriticalSection
(
&
handler
->
cs
);
heap_
free
(
handler
);
free
(
handler
);
}
return
refcount
;
...
...
@@ -1410,8 +1388,7 @@ HRESULT WINAPI MFCreateSimpleTypeHandler(IMFMediaTypeHandler **handler)
TRACE
(
"%p.
\n
"
,
handler
);
object
=
heap_alloc_zero
(
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IMFMediaTypeHandler_iface
.
lpVtbl
=
&
simple_type_handler_vtbl
;
...
...
dlls/mf/mf_private.h
View file @
bab4f293
...
...
@@ -20,7 +20,6 @@
#include "mfidl.h"
#include "mfapi.h"
#include "wine/heap.h"
#include "wine/debug.h"
static
inline
BOOL
mf_array_reserve
(
void
**
elements
,
size_t
*
capacity
,
size_t
count
,
size_t
size
)
...
...
@@ -41,7 +40,7 @@ static inline BOOL mf_array_reserve(void **elements, size_t *capacity, size_t co
if
(
new_capacity
<
count
)
new_capacity
=
max_capacity
;
if
(
!
(
new_elements
=
heap_
realloc
(
*
elements
,
new_capacity
*
size
)))
if
(
!
(
new_elements
=
realloc
(
*
elements
,
new_capacity
*
size
)))
return
FALSE
;
*
elements
=
new_elements
;
...
...
dlls/mf/samplegrabber.c
View file @
bab4f293
...
...
@@ -24,7 +24,6 @@
#include "mf_private.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
mfplat
);
...
...
@@ -105,7 +104,7 @@ static void sample_grabber_free_private(void *user_context)
struct
sample_grabber_activate_context
*
context
=
user_context
;
IMFMediaType_Release
(
context
->
media_type
);
IMFSampleGrabberSinkCallback_Release
(
context
->
callback
);
heap_
free
(
context
);
free
(
context
);
}
static
struct
sample_grabber
*
impl_from_IMFMediaSink
(
IMFMediaSink
*
iface
)
...
...
@@ -194,7 +193,7 @@ static void stream_release_pending_item(struct scheduled_item *item)
PropVariantClear
(
&
item
->
u
.
marker
.
context
);
break
;
}
heap_
free
(
item
);
free
(
item
);
}
static
ULONG
WINAPI
sample_grabber_stream_Release
(
IMFStreamSink
*
iface
)
...
...
@@ -386,7 +385,7 @@ static HRESULT stream_queue_sample(struct sample_grabber *grabber, IMFSample *sa
if
(
FAILED
(
hr
=
IMFSample_GetSampleTime
(
sample
,
&
sampletime
)))
return
hr
;
if
(
!
(
item
=
heap_alloc_zero
(
sizeof
(
*
item
))))
if
(
!
(
item
=
calloc
(
1
,
sizeof
(
*
item
))))
return
E_OUTOFMEMORY
;
item
->
type
=
ITEM_TYPE_SAMPLE
;
...
...
@@ -467,7 +466,7 @@ static HRESULT stream_place_marker(struct sample_grabber *grabber, MFSTREAMSINK_
return
S_OK
;
}
if
(
!
(
item
=
heap_alloc_zero
(
sizeof
(
*
item
))))
if
(
!
(
item
=
calloc
(
1
,
sizeof
(
*
item
))))
return
E_OUTOFMEMORY
;
item
->
type
=
ITEM_TYPE_MARKER
;
...
...
@@ -866,7 +865,7 @@ static ULONG WINAPI sample_grabber_sink_Release(IMFMediaSink *iface)
IMFAttributes_Release
(
grabber
->
sample_attributes
);
sample_grabber_release_pending_items
(
grabber
);
DeleteCriticalSection
(
&
grabber
->
cs
);
heap_
free
(
grabber
);
free
(
grabber
);
}
return
refcount
;
...
...
@@ -1401,8 +1400,7 @@ static HRESULT sample_grabber_create_object(IMFAttributes *attributes, void *use
if
(
FAILED
(
IMFMediaType_GetMajorType
(
context
->
media_type
,
&
guid
)))
return
MF_E_INVALIDMEDIATYPE
;
object
=
heap_alloc_zero
(
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IMFMediaSink_iface
.
lpVtbl
=
&
sample_grabber_sink_vtbl
;
...
...
@@ -1478,8 +1476,7 @@ HRESULT WINAPI MFCreateSampleGrabberSinkActivate(IMFMediaType *media_type, IMFSa
if
(
!
media_type
||
!
callback
||
!
activate
)
return
E_POINTER
;
context
=
heap_alloc_zero
(
sizeof
(
*
context
));
if
(
!
context
)
if
(
!
(
context
=
calloc
(
1
,
sizeof
(
*
context
))))
return
E_OUTOFMEMORY
;
context
->
media_type
=
media_type
;
...
...
dlls/mf/sar.c
View file @
bab4f293
...
...
@@ -26,7 +26,6 @@
#include "audioclient.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
mfplat
);
...
...
@@ -121,7 +120,7 @@ static void release_pending_object(struct queued_object *object)
PropVariantClear
(
&
object
->
u
.
marker
.
context
);
break
;
}
heap_
free
(
object
);
free
(
object
);
}
static
struct
audio_renderer
*
impl_from_IMFMediaSink
(
IMFMediaSink
*
iface
)
...
...
@@ -279,7 +278,7 @@ static ULONG WINAPI audio_renderer_sink_Release(IMFMediaSink *iface)
audio_renderer_release_audio_client
(
renderer
);
CloseHandle
(
renderer
->
buffer_ready_event
);
DeleteCriticalSection
(
&
renderer
->
cs
);
heap_
free
(
renderer
);
free
(
renderer
);
}
return
refcount
;
...
...
@@ -1332,7 +1331,7 @@ static HRESULT stream_queue_sample(struct audio_renderer *renderer, IMFSample *s
{
struct
queued_object
*
object
;
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
type
=
OBJECT_TYPE_SAMPLE
;
...
...
@@ -1372,7 +1371,7 @@ static HRESULT stream_place_marker(struct audio_renderer *renderer, MFSTREAMSINK
struct
queued_object
*
marker
;
HRESULT
hr
=
S_OK
;
if
(
!
(
marker
=
heap_alloc_zero
(
sizeof
(
*
marker
))))
if
(
!
(
marker
=
calloc
(
1
,
sizeof
(
*
marker
))))
return
E_OUTOFMEMORY
;
marker
->
type
=
OBJECT_TYPE_MARKER
;
...
...
@@ -1843,7 +1842,7 @@ static HRESULT sar_create_object(IMFAttributes *attributes, void *user_context,
TRACE
(
"%p, %p, %p.
\n
"
,
attributes
,
user_context
,
obj
);
if
(
!
(
renderer
=
heap_alloc_zero
(
sizeof
(
*
renderer
))))
if
(
!
(
renderer
=
calloc
(
1
,
sizeof
(
*
renderer
))))
return
E_OUTOFMEMORY
;
renderer
->
IMFMediaSink_iface
.
lpVtbl
=
&
audio_renderer_sink_vtbl
;
...
...
dlls/mf/session.c
View file @
bab4f293
...
...
@@ -28,7 +28,6 @@
#include "evr.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
#include "mf_private.h"
...
...
@@ -431,7 +430,7 @@ static ULONG WINAPI session_op_Release(IUnknown *iface)
default:
;
}
heap_
free
(
op
);
free
(
op
);
}
return
refcount
;
...
...
@@ -448,7 +447,7 @@ static HRESULT create_session_op(enum session_command command, struct session_op
{
struct
session_op
*
op
;
if
(
!
(
op
=
heap_alloc_zero
(
sizeof
(
*
op
))))
if
(
!
(
op
=
calloc
(
1
,
sizeof
(
*
op
))))
return
E_OUTOFMEMORY
;
op
->
IUnknown_iface
.
lpVtbl
=
&
session_op_vtbl
;
...
...
@@ -511,7 +510,7 @@ static void session_clear_topologies(struct media_session *session)
{
list_remove
(
&
ptr
->
entry
);
IMFTopology_Release
(
ptr
->
topology
);
heap_
free
(
ptr
);
free
(
ptr
);
}
}
...
...
@@ -640,7 +639,7 @@ static void transform_release_sample(struct sample *sample)
list_remove
(
&
sample
->
entry
);
if
(
sample
->
sample
)
IMFSample_Release
(
sample
->
sample
);
heap_
free
(
sample
);
free
(
sample
);
}
static
void
transform_stream_drop_samples
(
struct
transform_stream
*
stream
)
...
...
@@ -666,10 +665,10 @@ static void release_topo_node(struct topo_node *node)
transform_stream_drop_samples
(
&
node
->
u
.
transform
.
inputs
[
i
]);
for
(
i
=
0
;
i
<
node
->
u
.
transform
.
output_count
;
++
i
)
transform_stream_drop_samples
(
&
node
->
u
.
transform
.
outputs
[
i
]);
heap_
free
(
node
->
u
.
transform
.
inputs
);
heap_
free
(
node
->
u
.
transform
.
outputs
);
heap_
free
(
node
->
u
.
transform
.
input_map
);
heap_
free
(
node
->
u
.
transform
.
output_map
);
free
(
node
->
u
.
transform
.
inputs
);
free
(
node
->
u
.
transform
.
outputs
);
free
(
node
->
u
.
transform
.
input_map
);
free
(
node
->
u
.
transform
.
output_map
);
break
;
case
MF_TOPOLOGY_OUTPUT_NODE
:
if
(
node
->
u
.
sink
.
allocator
)
...
...
@@ -688,7 +687,7 @@ static void release_topo_node(struct topo_node *node)
IUnknown_Release
(
node
->
object
.
object
);
if
(
node
->
node
)
IMFTopologyNode_Release
(
node
->
node
);
heap_
free
(
node
);
free
(
node
);
}
static
void
session_shutdown_current_topology
(
struct
media_session
*
session
)
...
...
@@ -771,7 +770,7 @@ static void session_clear_presentation(struct media_session *session)
IMFMediaSource_Release
(
source
->
source
);
if
(
source
->
pd
)
IMFPresentationDescriptor_Release
(
source
->
pd
);
heap_
free
(
source
);
free
(
source
);
}
LIST_FOR_EACH_ENTRY_SAFE
(
node
,
node2
,
&
session
->
presentation
.
nodes
,
struct
topo_node
,
entry
)
...
...
@@ -790,7 +789,7 @@ static void session_clear_presentation(struct media_session *session)
IMFMediaSinkPreroll_Release
(
sink
->
preroll
);
if
(
sink
->
event_generator
)
IMFMediaEventGenerator_Release
(
sink
->
event_generator
);
heap_
free
(
sink
);
free
(
sink
);
}
}
...
...
@@ -1078,7 +1077,7 @@ static void session_release_media_source(struct media_source *source)
IMFMediaSource_Release
(
source
->
source
);
if
(
source
->
pd
)
IMFPresentationDescriptor_Release
(
source
->
pd
);
heap_
free
(
source
);
free
(
source
);
}
static
HRESULT
session_add_media_source
(
struct
media_session
*
session
,
IMFTopologyNode
*
node
,
IMFMediaSource
*
source
)
...
...
@@ -1089,7 +1088,7 @@ static HRESULT session_add_media_source(struct media_session *session, IMFTopolo
if
(
session_get_media_source
(
session
,
source
))
return
S_FALSE
;
if
(
!
(
media_source
=
heap_alloc_zero
(
sizeof
(
*
media_source
))))
if
(
!
(
media_source
=
calloc
(
1
,
sizeof
(
*
media_source
))))
return
E_OUTOFMEMORY
;
media_source
->
source
=
source
;
...
...
@@ -1150,7 +1149,7 @@ static HRESULT session_add_media_sink(struct media_session *session, IMFTopology
return
S_FALSE
;
}
if
(
!
(
media_sink
=
heap_alloc_zero
(
sizeof
(
*
media_sink
))))
if
(
!
(
media_sink
=
calloc
(
1
,
sizeof
(
*
media_sink
))))
return
E_OUTOFMEMORY
;
media_sink
->
sink
=
sink
;
...
...
@@ -1188,14 +1187,14 @@ static HRESULT session_set_transform_stream_info(struct topo_node *node)
hr
=
IMFTransform_GetStreamCount
(
node
->
object
.
transform
,
&
input_count
,
&
output_count
);
if
(
SUCCEEDED
(
hr
)
&&
(
input_count
>
1
||
output_count
>
1
))
{
input_map
=
heap_
calloc
(
input_count
,
sizeof
(
*
input_map
));
output_map
=
heap_
calloc
(
output_count
,
sizeof
(
*
output_map
));
input_map
=
calloc
(
input_count
,
sizeof
(
*
input_map
));
output_map
=
calloc
(
output_count
,
sizeof
(
*
output_map
));
if
(
FAILED
(
IMFTransform_GetStreamIDs
(
node
->
object
.
transform
,
input_count
,
input_map
,
output_count
,
output_map
)))
{
/* Assume sequential identifiers. */
heap_
free
(
input_map
);
heap_
free
(
output_map
);
free
(
input_map
);
free
(
output_map
);
input_map
=
output_map
=
NULL
;
}
}
...
...
@@ -1205,13 +1204,13 @@ static HRESULT session_set_transform_stream_info(struct topo_node *node)
node
->
u
.
transform
.
input_map
=
input_map
;
node
->
u
.
transform
.
output_map
=
output_map
;
streams
=
heap_
calloc
(
input_count
,
sizeof
(
*
streams
));
streams
=
calloc
(
input_count
,
sizeof
(
*
streams
));
for
(
i
=
0
;
i
<
input_count
;
++
i
)
list_init
(
&
streams
[
i
].
samples
);
node
->
u
.
transform
.
inputs
=
streams
;
node
->
u
.
transform
.
input_count
=
input_count
;
streams
=
heap_
calloc
(
output_count
,
sizeof
(
*
streams
));
streams
=
calloc
(
output_count
,
sizeof
(
*
streams
));
for
(
i
=
0
;
i
<
output_count
;
++
i
)
{
list_init
(
&
streams
[
i
].
samples
);
...
...
@@ -1306,7 +1305,7 @@ static HRESULT session_append_node(struct media_session *session, IMFTopologyNod
IMFStreamDescriptor
*
sd
;
HRESULT
hr
=
S_OK
;
if
(
!
(
topo_node
=
heap_alloc_zero
(
sizeof
(
*
topo_node
))))
if
(
!
(
topo_node
=
calloc
(
1
,
sizeof
(
*
topo_node
))))
return
E_OUTOFMEMORY
;
IMFTopologyNode_GetNodeType
(
node
,
&
topo_node
->
type
);
...
...
@@ -1573,7 +1572,7 @@ static void session_set_topology(struct media_session *session, DWORD flags, IMF
{
struct
queued_topology
*
queued_topology
;
if
((
queued_topology
=
heap_alloc_zero
(
sizeof
(
*
queued_topology
))))
if
((
queued_topology
=
calloc
(
1
,
sizeof
(
*
queued_topology
))))
{
queued_topology
->
topology
=
topology
;
IMFTopology_AddRef
(
queued_topology
->
topology
);
...
...
@@ -1655,7 +1654,7 @@ static ULONG WINAPI mfsession_Release(IMFMediaSession *iface)
if
(
session
->
quality_manager
)
IMFQualityManager_Release
(
session
->
quality_manager
);
DeleteCriticalSection
(
&
session
->
cs
);
heap_
free
(
session
);
free
(
session
);
}
return
refcount
;
...
...
@@ -2596,7 +2595,7 @@ static void session_set_sink_stream_state(struct media_session *session, IMFStre
static
struct
sample
*
transform_create_sample
(
IMFSample
*
sample
)
{
struct
sample
*
sample_entry
=
heap_alloc_zero
(
sizeof
(
*
sample_entry
));
struct
sample
*
sample_entry
=
calloc
(
1
,
sizeof
(
*
sample_entry
));
if
(
sample_entry
)
{
...
...
@@ -2660,7 +2659,7 @@ static HRESULT transform_node_pull_samples(const struct media_session *session,
unsigned
int
i
;
HRESULT
hr
=
E_UNEXPECTED
;
if
(
!
(
buffers
=
heap_
calloc
(
node
->
u
.
transform
.
output_count
,
sizeof
(
*
buffers
))))
if
(
!
(
buffers
=
calloc
(
node
->
u
.
transform
.
output_count
,
sizeof
(
*
buffers
))))
return
E_OUTOFMEMORY
;
for
(
i
=
0
;
i
<
node
->
u
.
transform
.
output_count
;
++
i
)
...
...
@@ -2703,7 +2702,7 @@ static HRESULT transform_node_pull_samples(const struct media_session *session,
IMFSample_Release
(
buffers
[
i
].
pSample
);
}
heap_
free
(
buffers
);
free
(
buffers
);
return
hr
;
}
...
...
@@ -3611,8 +3610,7 @@ HRESULT WINAPI MFCreateMediaSession(IMFAttributes *config, IMFMediaSession **ses
TRACE
(
"%p, %p.
\n
"
,
config
,
session
);
object
=
heap_alloc_zero
(
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IMFMediaSession_iface
.
lpVtbl
=
&
mfmediasessionvtbl
;
...
...
@@ -3749,7 +3747,7 @@ static ULONG WINAPI standard_quality_manager_Release(IMFQualityManager *iface)
if
(
manager
->
topology
)
IMFTopology_Release
(
manager
->
topology
);
DeleteCriticalSection
(
&
manager
->
cs
);
heap_
free
(
manager
);
free
(
manager
);
}
return
refcount
;
...
...
@@ -3941,8 +3939,7 @@ HRESULT WINAPI MFCreateStandardQualityManager(IMFQualityManager **manager)
TRACE
(
"%p.
\n
"
,
manager
);
object
=
heap_alloc_zero
(
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IMFQualityManager_iface
.
lpVtbl
=
&
standard_quality_manager_vtbl
;
...
...
dlls/mf/topology.c
View file @
bab4f293
...
...
@@ -256,7 +256,7 @@ static void topology_clear(struct topology *topology)
topology_node_disconnect
(
topology
->
nodes
.
nodes
[
i
]);
IMFTopologyNode_Release
(
&
topology
->
nodes
.
nodes
[
i
]
->
IMFTopologyNode_iface
);
}
heap_
free
(
topology
->
nodes
.
nodes
);
free
(
topology
->
nodes
.
nodes
);
topology
->
nodes
.
nodes
=
NULL
;
topology
->
nodes
.
count
=
0
;
topology
->
nodes
.
size
=
0
;
...
...
@@ -274,7 +274,7 @@ static ULONG WINAPI topology_Release(IMFTopology *iface)
if
(
topology
->
attributes
)
IMFAttributes_Release
(
topology
->
attributes
);
topology_clear
(
topology
);
heap_
free
(
topology
);
free
(
topology
);
}
return
refcount
;
...
...
@@ -885,8 +885,7 @@ HRESULT WINAPI MFCreateTopology(IMFTopology **topology)
if
(
!
topology
)
return
E_POINTER
;
object
=
heap_alloc_zero
(
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IMFTopology_iface
.
lpVtbl
=
&
topologyvtbl
;
...
...
@@ -961,11 +960,11 @@ static ULONG WINAPI topology_node_Release(IMFTopologyNode *iface)
if
(
node
->
outputs
.
streams
[
i
].
preferred_type
)
IMFMediaType_Release
(
node
->
outputs
.
streams
[
i
].
preferred_type
);
}
heap_
free
(
node
->
inputs
.
streams
);
heap_
free
(
node
->
outputs
.
streams
);
free
(
node
->
inputs
.
streams
);
free
(
node
->
outputs
.
streams
);
IMFAttributes_Release
(
node
->
attributes
);
DeleteCriticalSection
(
&
node
->
cs
);
heap_
free
(
node
);
free
(
node
);
}
return
refcount
;
...
...
@@ -1767,8 +1766,7 @@ static HRESULT create_topology_node(MF_TOPOLOGY_TYPE node_type, struct topology_
{
HRESULT
hr
;
*
node
=
heap_alloc_zero
(
sizeof
(
**
node
));
if
(
!*
node
)
if
(
!
(
*
node
=
calloc
(
1
,
sizeof
(
**
node
))))
return
E_OUTOFMEMORY
;
(
*
node
)
->
IMFTopologyNode_iface
.
lpVtbl
=
&
topologynodevtbl
;
...
...
@@ -1777,7 +1775,7 @@ static HRESULT create_topology_node(MF_TOPOLOGY_TYPE node_type, struct topology_
hr
=
MFCreateAttributes
(
&
(
*
node
)
->
attributes
,
0
);
if
(
FAILED
(
hr
))
{
heap_
free
(
*
node
);
free
(
*
node
);
return
hr
;
}
(
*
node
)
->
id
=
((
TOPOID
)
GetCurrentProcessId
()
<<
32
)
|
InterlockedIncrement
(
&
next_node_id
);
...
...
@@ -1931,9 +1929,7 @@ static ULONG WINAPI topology_loader_Release(IMFTopoLoader *iface)
TRACE
(
"%p, refcount %u.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
{
heap_free
(
loader
);
}
free
(
loader
);
return
refcount
;
}
...
...
@@ -2692,8 +2688,7 @@ HRESULT WINAPI MFCreateTopoLoader(IMFTopoLoader **loader)
if
(
!
loader
)
return
E_POINTER
;
object
=
heap_alloc
(
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IMFTopoLoader_iface
.
lpVtbl
=
&
topologyloadervtbl
;
...
...
@@ -2751,9 +2746,7 @@ static ULONG WINAPI seq_source_Release(IMFSequencerSource *iface)
TRACE
(
"%p, refcount %u.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
{
heap_free
(
seq_source
);
}
free
(
seq_source
);
return
refcount
;
}
...
...
@@ -2855,8 +2848,7 @@ HRESULT WINAPI MFCreateSequencerSource(IUnknown *reserved, IMFSequencerSource **
if
(
!
seq_source
)
return
E_POINTER
;
object
=
heap_alloc
(
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IMFSequencerSource_iface
.
lpVtbl
=
&
seqsourcevtbl
;
...
...
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