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
195f735c
Commit
195f735c
authored
Apr 08, 2021
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr: Use CRT functions for heap allocations.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
437bc14a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
22 deletions
+19
-22
mixer.c
dlls/evr/mixer.c
+4
-5
presenter.c
dlls/evr/presenter.c
+3
-4
sample.c
dlls/evr/sample.c
+12
-13
No files found.
dlls/evr/mixer.c
View file @
195f735c
...
...
@@ -31,7 +31,6 @@
#include "evcode.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
evr
);
...
...
@@ -200,7 +199,7 @@ static void video_mixer_clear_types(struct video_mixer *mixer)
{
IMFMediaType_Release
(
mixer
->
output
.
rt_formats
[
i
].
media_type
);
}
heap_
free
(
mixer
->
output
.
rt_formats
);
free
(
mixer
->
output
.
rt_formats
);
if
(
mixer
->
output
.
media_type
)
IMFMediaType_Release
(
mixer
->
output
.
media_type
);
mixer
->
output
.
media_type
=
NULL
;
...
...
@@ -668,7 +667,7 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const
if
(
SUCCEEDED
(
IDirectXVideoProcessorService_GetVideoProcessorRenderTargets
(
service
,
&
devices
[
i
],
video_desc
,
&
format_count
,
&
formats
)))
{
if
(
!
(
ptr
=
heap_
realloc
(
rt_formats
,
(
count
+
format_count
)
*
sizeof
(
*
rt_formats
))))
if
(
!
(
ptr
=
realloc
(
rt_formats
,
(
count
+
format_count
)
*
sizeof
(
*
rt_formats
))))
{
hr
=
E_OUTOFMEMORY
;
count
=
0
;
...
...
@@ -703,7 +702,7 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const
count
=
j
+
1
;
memcpy
(
&
subtype
,
&
MFVideoFormat_Base
,
sizeof
(
subtype
));
if
((
mixer
->
output
.
rt_formats
=
heap_
calloc
(
count
,
sizeof
(
*
mixer
->
output
.
rt_formats
))))
if
((
mixer
->
output
.
rt_formats
=
calloc
(
count
,
sizeof
(
*
mixer
->
output
.
rt_formats
))))
{
for
(
i
=
0
;
i
<
count
;
++
i
)
{
...
...
@@ -727,7 +726,7 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const
}
}
heap_
free
(
rt_formats
);
free
(
rt_formats
);
return
count
?
S_OK
:
hr
;
}
...
...
dlls/evr/presenter.c
View file @
195f735c
...
...
@@ -28,7 +28,6 @@
#include "evr_private.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
evr
);
...
...
@@ -369,7 +368,7 @@ static void video_presenter_sample_queue_init(struct video_presenter *presenter)
return
;
memset
(
queue
,
0
,
sizeof
(
*
queue
));
queue
->
samples
=
heap_
calloc
(
presenter
->
allocator_capacity
,
sizeof
(
*
queue
->
samples
));
queue
->
samples
=
calloc
(
presenter
->
allocator_capacity
,
sizeof
(
*
queue
->
samples
));
queue
->
size
=
presenter
->
allocator_capacity
;
queue
->
back
=
queue
->
size
-
1
;
}
...
...
@@ -836,7 +835,7 @@ static ULONG WINAPI video_presenter_inner_Release(IUnknown *iface)
}
if
(
presenter
->
allocator
)
IMFVideoSampleAllocator_Release
(
presenter
->
allocator
);
heap_
free
(
presenter
);
free
(
presenter
);
}
return
refcount
;
...
...
@@ -1929,7 +1928,7 @@ HRESULT evr_presenter_create(IUnknown *outer, void **out)
*
out
=
NULL
;
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IMFVideoPresenter_iface
.
lpVtbl
=
&
video_presenter_vtbl
;
...
...
dlls/evr/sample.c
View file @
195f735c
...
...
@@ -25,7 +25,6 @@
#include "dxva2api.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
evr
);
...
...
@@ -168,7 +167,7 @@ static ULONG WINAPI tracked_async_result_Release(IMFAsyncResult *iface)
IUnknown_Release
(
result
->
object
);
if
(
result
->
state
)
IUnknown_Release
(
result
->
state
);
heap_
free
(
result
);
free
(
result
);
}
return
refcount
;
...
...
@@ -250,7 +249,7 @@ static HRESULT create_async_result(IUnknown *object, IMFAsyncCallback *callback,
{
struct
tracked_async_result
*
result
;
result
=
heap_alloc_zero
(
sizeof
(
*
result
));
result
=
calloc
(
1
,
sizeof
(
*
result
));
if
(
!
result
)
return
E_OUTOFMEMORY
;
...
...
@@ -464,13 +463,13 @@ static void sample_allocator_release_samples(struct sample_allocator *allocator)
{
list_remove
(
&
iter
->
entry
);
IMFSample_Release
(
iter
->
sample
);
heap_
free
(
iter
);
free
(
iter
);
}
LIST_FOR_EACH_ENTRY_SAFE
(
iter
,
iter2
,
&
allocator
->
used_samples
,
struct
queued_sample
,
entry
)
{
list_remove
(
&
iter
->
entry
);
heap_
free
(
iter
);
free
(
iter
);
}
}
...
...
@@ -489,7 +488,7 @@ static ULONG WINAPI sample_allocator_Release(IMFVideoSampleAllocator *iface)
IDirect3DDeviceManager9_Release
(
allocator
->
device_manager
);
sample_allocator_release_samples
(
allocator
);
DeleteCriticalSection
(
&
allocator
->
cs
);
heap_
free
(
allocator
);
free
(
allocator
);
}
return
refcount
;
...
...
@@ -618,7 +617,7 @@ static HRESULT sample_allocator_create_samples(struct sample_allocator *allocato
break
;
}
queued_sample
=
heap_
alloc
(
sizeof
(
*
queued_sample
));
queued_sample
=
m
alloc
(
sizeof
(
*
queued_sample
));
queued_sample
->
sample
=
sample
;
list_add_tail
(
&
allocator
->
free_samples
,
&
queued_sample
->
entry
);
allocator
->
free_sample_count
++
;
...
...
@@ -860,7 +859,7 @@ HRESULT WINAPI MFCreateVideoSampleAllocator(REFIID riid, void **obj)
TRACE
(
"%s, %p.
\n
"
,
debugstr_guid
(
riid
),
obj
);
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IMFVideoSampleAllocator_iface
.
lpVtbl
=
&
sample_allocator_vtbl
;
...
...
@@ -943,7 +942,7 @@ static ULONG WINAPI video_sample_Release(IMFSample *iface)
if
(
sample
->
sample
)
IMFSample_Release
(
sample
->
sample
);
DeleteCriticalSection
(
&
sample
->
cs
);
heap_
free
(
sample
);
free
(
sample
);
}
return
refcount
;
...
...
@@ -1601,7 +1600,7 @@ static ULONG WINAPI surface_buffer_Release(IMFMediaBuffer *iface)
if
(
!
refcount
)
{
IUnknown_Release
(
buffer
->
surface
);
heap_
free
(
buffer
);
free
(
buffer
);
}
return
refcount
;
...
...
@@ -1704,7 +1703,7 @@ static HRESULT create_surface_buffer(IUnknown *surface, IMFMediaBuffer **buffer)
{
struct
surface_buffer
*
object
;
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IMFMediaBuffer_iface
.
lpVtbl
=
&
surface_buffer_vtbl
;
...
...
@@ -1726,7 +1725,7 @@ HRESULT WINAPI MFCreateVideoSampleFromSurface(IUnknown *surface, IMFSample **sam
TRACE
(
"%p, %p.
\n
"
,
surface
,
sample
);
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IMFSample_iface
.
lpVtbl
=
&
video_sample_vtbl
;
...
...
@@ -1737,7 +1736,7 @@ HRESULT WINAPI MFCreateVideoSampleFromSurface(IUnknown *surface, IMFSample **sam
if
(
FAILED
(
hr
=
MFCreateSample
(
&
object
->
sample
)))
{
heap_
free
(
object
);
free
(
object
);
return
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