On 9/8/22 01:56, Rémi Bernon wrote:
@@ -440,18 +454,23 @@ static HRESULT WINAPI WMReader_Start(IWMReader *iface, if (rate != 1.0f) FIXME("Ignoring rate %.8e.\n", rate);
+ if (!(info = calloc(1, sizeof(*info)))) + return E_OUTOFMEMORY; + info->start = start; + info->duration = duration; + info->context = context; + EnterCriticalSection(&reader->reader.cs);
if (!reader->callback_thread) hr = NS_E_INVALID_REQUEST; else - { - wm_reader_seek(&reader->reader, start, duration); - hr = async_reader_queue_op(reader, ASYNC_OP_START, context); - } + hr = async_reader_queue_op(reader, ASYNC_OP_START, info);
LeaveCriticalSection(&reader->reader.cs);
+ if (FAILED(hr)) + free(info); return hr; }
Can we just embed this directly into the async_op structure (perhaps with a union), and avoid the extra allocation?