Commit 33208d8a authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfreadwrite/tests: Use CRT allocation functions.

parent b5f92fe7
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment