[PATCH] mfreadwrite/tests: Use CRT allocation functions.
Nikolay Sivov
nsivov at codeweavers.com
Thu Jan 20 04:36:48 CST 2022
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/mfreadwrite/tests/mfplat.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/dlls/mfreadwrite/tests/mfplat.c b/dlls/mfreadwrite/tests/mfplat.c
index e3ff7f6e7aa..7e724344168 100644
--- a/dlls/mfreadwrite/tests/mfplat.c
+++ b/dlls/mfreadwrite/tests/mfplat.c
@@ -40,7 +40,6 @@ DEFINE_GUID(GUID_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
#include "d3d9.h"
#include "dxva2api.h"
-#include "wine/heap.h"
#include "wine/test.h"
static ULONG get_refcount(void *iface)
@@ -145,7 +144,7 @@ static ULONG WINAPI test_media_stream_Release(IMFMediaStream *iface)
if (!refcount)
{
IMFMediaEventQueue_Release(stream->event_queue);
- heap_free(stream);
+ free(stream);
}
return refcount;
@@ -297,7 +296,7 @@ static ULONG WINAPI test_source_Release(IMFMediaSource *iface)
if (!refcount)
{
IMFMediaEventQueue_Release(source->event_queue);
- heap_free(source);
+ free(source);
}
return refcount;
@@ -488,7 +487,7 @@ static struct test_media_stream *create_test_stream(DWORD stream_index, IMFMedia
BOOL selected;
HRESULT hr;
- stream = heap_alloc_zero(sizeof(*stream));
+ stream = calloc(1, sizeof(*stream));
stream->IMFMediaStream_iface.lpVtbl = &test_media_stream_vtbl;
stream->refcount = 1;
hr = MFCreateEventQueue(&stream->event_queue);
@@ -509,7 +508,7 @@ static IMFMediaSource *create_test_source(int stream_count)
struct test_source *source;
int i;
- source = heap_alloc_zero(sizeof(*source));
+ source = calloc(1, sizeof(*source));
source->IMFMediaSource_iface.lpVtbl = &test_source_vtbl;
source->refcount = 1;
source->stream_count = stream_count;
@@ -606,9 +605,7 @@ static ULONG WINAPI async_callback_Release(IMFSourceReaderCallback *iface)
ULONG refcount = InterlockedDecrement(&callback->refcount);
if (!refcount)
- {
- heap_free(callback);
- }
+ free(callback);
return refcount;
}
@@ -646,7 +643,7 @@ static struct async_callback *create_async_callback(void)
{
struct async_callback *callback;
- callback = heap_alloc(sizeof(*callback));
+ callback = calloc(1, sizeof(*callback));
callback->IMFSourceReaderCallback_iface.lpVtbl = &async_callback_vtbl;
callback->refcount = 1;
--
2.34.1
More information about the wine-devel
mailing list