Commit 2764d3e3 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

evr/presenter: Add missing allocation error path.

parent 79e2d5d3
......@@ -391,17 +391,21 @@ static HRESULT video_presenter_invalidate_media_type(struct video_presenter *pre
return hr;
}
static void video_presenter_sample_queue_init(struct video_presenter *presenter)
static HRESULT video_presenter_sample_queue_init(struct video_presenter *presenter)
{
struct sample_queue *queue = &presenter->thread.queue;
if (queue->size)
return;
return S_OK;
memset(queue, 0, sizeof(*queue));
queue->samples = calloc(presenter->allocator_capacity, sizeof(*queue->samples));
if (!(queue->samples = calloc(presenter->allocator_capacity, sizeof(*queue->samples))))
return E_OUTOFMEMORY;
queue->size = presenter->allocator_capacity;
queue->back = queue->size - 1;
return S_OK;
}
static void video_presenter_sample_queue_push(struct video_presenter *presenter, IMFSample *sample)
......@@ -714,10 +718,13 @@ static DWORD CALLBACK video_presenter_streaming_thread(void *arg)
static HRESULT video_presenter_start_streaming(struct video_presenter *presenter)
{
HRESULT hr;
if (presenter->thread.hthread)
return S_OK;
video_presenter_sample_queue_init(presenter);
if (FAILED(hr = video_presenter_sample_queue_init(presenter)))
return hr;
if (!(presenter->thread.ready_event = CreateEventW(NULL, FALSE, FALSE, NULL)))
return HRESULT_FROM_WIN32(GetLastError());
......
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