Anton Baskanov (@baskanov) commented about dlls/amstream/ddrawstream.c:
DWORD flags)
{ struct ddraw_stream *stream = impl_from_IMemAllocator(iface);
- HRESULT hr;
- return IMemAllocator_GetBuffer(stream->private_allocator, buf, start_time, end_time, flags);
- EnterCriticalSection(&stream->cs);
- hr = IMemAllocator_GetBuffer(stream->private_allocator, buf, start_time, end_time, flags);
- IMediaSample_SetMediaType(*buf, &stream->mt);
If `IMemAllocator_GetBuffer()` fails (e.g. when the allocator is decommitted) `*buf` will contain garbage. You should check `hr` before accessing it.