Commit e73f31a6 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

quartz: Don't crash if sample allocation fails.

parent d0b7a70b
...@@ -202,20 +202,20 @@ static HRESULT FillBuffer(MPEGSplitterImpl *This, IMediaSample *pCurrentSample) ...@@ -202,20 +202,20 @@ static HRESULT FillBuffer(MPEGSplitterImpl *This, IMediaSample *pCurrentSample)
LONGLONG rtSampleStart = pin->rtNext - MEDIATIME_FROM_BYTES(4); LONGLONG rtSampleStart = pin->rtNext - MEDIATIME_FROM_BYTES(4);
LONGLONG rtSampleStop = rtSampleStart + MEDIATIME_FROM_BYTES(length + 4); LONGLONG rtSampleStop = rtSampleStart + MEDIATIME_FROM_BYTES(length + 4);
hr = IMemAllocator_GetBuffer(pin->pAlloc, &sample, NULL, NULL, 0);
if (rtSampleStop > pin->rtStop) if (rtSampleStop > pin->rtStop)
rtSampleStop = MEDIATIME_FROM_BYTES(ALIGNUP(BYTES_FROM_MEDIATIME(pin->rtStop), pin->cbAlign)); rtSampleStop = MEDIATIME_FROM_BYTES(ALIGNUP(BYTES_FROM_MEDIATIME(pin->rtStop), pin->cbAlign));
hr = IMemAllocator_GetBuffer(pin->pAlloc, &sample, NULL, NULL, 0);
if (SUCCEEDED(hr))
{
IMediaSample_SetTime(sample, &rtSampleStart, &rtSampleStop); IMediaSample_SetTime(sample, &rtSampleStart, &rtSampleStop);
IMediaSample_SetPreroll(sample, 0); IMediaSample_SetPreroll(sample, 0);
IMediaSample_SetDiscontinuity(sample, 0); IMediaSample_SetDiscontinuity(sample, 0);
IMediaSample_SetSyncPoint(sample, 1); IMediaSample_SetSyncPoint(sample, 1);
pin->rtCurrent = rtSampleStart; pin->rtCurrent = rtSampleStart;
pin->rtNext = rtSampleStop; pin->rtNext = rtSampleStop;
if (SUCCEEDED(hr))
hr = IAsyncReader_Request(pin->pReader, sample, 0); hr = IAsyncReader_Request(pin->pReader, sample, 0);
}
if (FAILED(hr)) if (FAILED(hr))
FIXME("o_Ox%08x\n", hr); FIXME("o_Ox%08x\n", hr);
} }
......
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