Commit 4eb58312 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

quartz/vmr9: Avoid leaking the surface array on connection failure.

parent c4f92087
...@@ -428,11 +428,14 @@ static HRESULT allocate_surfaces(struct quartz_vmr *filter, const AM_MEDIA_TYPE ...@@ -428,11 +428,14 @@ static HRESULT allocate_surfaces(struct quartz_vmr *filter, const AM_MEDIA_TYPE
case 32: info.Format = D3DFMT_X8R8G8B8; break; case 32: info.Format = D3DFMT_X8R8G8B8; break;
default: default:
FIXME("Unhandled bit depth %u.\n", filter->bmiheader.biBitCount); FIXME("Unhandled bit depth %u.\n", filter->bmiheader.biBitCount);
free(filter->surfaces);
return E_INVALIDARG; return E_INVALIDARG;
} }
info.dwFlags = VMR9AllocFlag_TextureSurface; info.dwFlags = VMR9AllocFlag_TextureSurface;
return initialize_device(filter, &info, count); if (FAILED(hr = initialize_device(filter, &info, count)))
free(filter->surfaces);
return hr;
} }
for (i = 0; i < ARRAY_SIZE(formats); ++i) for (i = 0; i < ARRAY_SIZE(formats); ++i)
...@@ -457,6 +460,7 @@ static HRESULT allocate_surfaces(struct quartz_vmr *filter, const AM_MEDIA_TYPE ...@@ -457,6 +460,7 @@ static HRESULT allocate_surfaces(struct quartz_vmr *filter, const AM_MEDIA_TYPE
} }
} }
free(filter->surfaces);
return hr; return 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