Module: wine Branch: master Commit: 559d541cf8f42e5418710d1288eaaa15e2602f4c URL: http://source.winehq.org/git/wine.git/?a=commit;h=559d541cf8f42e5418710d1288... Author: Chris Robinson <chris.kcat(a)gmail.com> Date: Tue Mar 13 10:21:17 2007 -0700 quartz: Cleanup properly around error conditions and avoid a potential infinite loop. --- dlls/quartz/acmwrapper.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dlls/quartz/acmwrapper.c b/dlls/quartz/acmwrapper.c index 4b2d143..344779c 100644 --- a/dlls/quartz/acmwrapper.c +++ b/dlls/quartz/acmwrapper.c @@ -78,7 +78,7 @@ static HRESULT ACMWrapper_ProcessSampleData(TransformFilterImpl* pTransformFilte hr = IPin_ConnectionMediaType(This->tf.ppPins[0], &amt); if (FAILED(hr)) { ERR("Unable to retrieve media type\n"); - goto error; + return hr; } while(!stop) @@ -99,7 +99,7 @@ static HRESULT ACMWrapper_ProcessSampleData(TransformFilterImpl* pTransformFilte hr = OutputPin_GetDeliveryBuffer((OutputPin*)This->tf.ppPins[1], &pSample, NULL, NULL, 0); if (FAILED(hr)) { ERR("Unable to get delivery buffer (%x)\n", hr); - goto error; + return hr; } hr = IMediaSample_SetActualDataLength(pSample, 0); @@ -152,11 +152,13 @@ static HRESULT ACMWrapper_ProcessSampleData(TransformFilterImpl* pTransformFilte } error: - if (unprepare_header && (res = acmStreamUnprepareHeader(This->has, &ash, 0))) - ERR("Cannot unprepare header %d\n", res); + if (unprepare_header && (res = acmStreamUnprepareHeader(This->has, &ash, 0))) + ERR("Cannot unprepare header %d\n", res); + unprepare_header = FALSE; - if (pSample) - IMediaSample_Release(pSample); + if (pSample) + IMediaSample_Release(pSample); + pSample = NULL; } return hr;