mfreadwrite/reader: Add missing allocation check (Coverity).

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2021-04-12 17:40:02 +03:00 committed by Alexandre Julliard
parent babdaffff7
commit 129e5660e3
1 changed files with 7 additions and 4 deletions

View File

@ -442,12 +442,14 @@ static void source_reader_set_sa_response(struct source_reader *reader, struct s
} }
} }
static void source_reader_queue_response(struct source_reader *reader, struct media_stream *stream, HRESULT status, static HRESULT source_reader_queue_response(struct source_reader *reader, struct media_stream *stream, HRESULT status,
DWORD stream_flags, LONGLONG timestamp, IMFSample *sample) DWORD stream_flags, LONGLONG timestamp, IMFSample *sample)
{ {
struct stream_response *response; struct stream_response *response;
response = calloc(1, sizeof(*response)); if (!(response = calloc(1, sizeof(*response))))
return E_OUTOFMEMORY;
response->status = status; response->status = status;
response->stream_index = stream->index; response->stream_index = stream->index;
response->stream_flags = stream_flags; response->stream_flags = stream_flags;
@ -466,6 +468,8 @@ static void source_reader_queue_response(struct source_reader *reader, struct me
stream->responses++; stream->responses++;
source_reader_response_ready(reader, response); source_reader_response_ready(reader, response);
return S_OK;
} }
static HRESULT source_reader_request_sample(struct source_reader *reader, struct media_stream *stream) static HRESULT source_reader_request_sample(struct source_reader *reader, struct media_stream *stream)
@ -716,8 +720,7 @@ static HRESULT source_reader_process_sample(struct source_reader *reader, struct
if (FAILED(IMFSample_GetSampleTime(sample, &timestamp))) if (FAILED(IMFSample_GetSampleTime(sample, &timestamp)))
WARN("Sample time wasn't set.\n"); WARN("Sample time wasn't set.\n");
source_reader_queue_response(reader, stream, S_OK, 0, timestamp, sample); return source_reader_queue_response(reader, stream, S_OK, 0, timestamp, sample);
return S_OK;
} }
/* It's assumed that decoder has 1 input and 1 output, both id's are 0. */ /* It's assumed that decoder has 1 input and 1 output, both id's are 0. */