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

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-06-19 19:50:16 -05:00 committed by Alexandre Julliard
parent c4f92087af
commit 4eb58312d6
1 changed files with 5 additions and 1 deletions

View File

@ -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
} }
} }
free(filter->surfaces);
return hr; return hr;
} }