strmbase: Fix some memory leaks (Valgrind).
Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
cf1b9fe2c7
commit
c7f51d85ec
|
@ -264,14 +264,17 @@ static HRESULT WINAPI IEnumMediaTypesImpl_Reset(IEnumMediaTypes * iface)
|
|||
CoTaskMemFree(This->enumMediaDetails.pMediaTypes);
|
||||
|
||||
i = 0;
|
||||
while (This->enumMediaFunction(This->basePin, i, &amt) == S_OK) i++;
|
||||
while (This->enumMediaFunction(This->basePin, i, &amt) == S_OK)
|
||||
{
|
||||
FreeMediaType(&amt);
|
||||
i++;
|
||||
}
|
||||
|
||||
This->enumMediaDetails.cMediaTypes = i;
|
||||
This->enumMediaDetails.pMediaTypes = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE) * i);
|
||||
for (i = 0; i < This->enumMediaDetails.cMediaTypes; i++)
|
||||
{
|
||||
This->enumMediaFunction(This->basePin, i,&amt);
|
||||
if (FAILED(CopyMediaType(&This->enumMediaDetails.pMediaTypes[i], &amt)))
|
||||
if (FAILED(This->enumMediaFunction(This->basePin, i, &This->enumMediaDetails.pMediaTypes[i])))
|
||||
{
|
||||
while (i--)
|
||||
FreeMediaType(&This->enumMediaDetails.pMediaTypes[i]);
|
||||
|
|
|
@ -346,6 +346,7 @@ HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample * pSamp
|
|||
{
|
||||
return VFW_E_TYPE_NOT_ACCEPTED;
|
||||
}
|
||||
DeleteMediaType(pmt);
|
||||
}
|
||||
|
||||
This->pMediaSample = pSample;
|
||||
|
|
Loading…
Reference in New Issue