Module: wine Branch: master Commit: 4eb58312d6056a21c54b0cb987439c63c796bf9e URL: https://source.winehq.org/git/wine.git/?a=commit;h=4eb58312d6056a21c54b0cb98...
Author: Zebediah Figura z.figura12@gmail.com Date: Fri Jun 19 19:50:16 2020 -0500
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
---
dlls/quartz/vmr9.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index d4331d321d..3636d47702 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -428,11 +428,14 @@ static HRESULT allocate_surfaces(struct quartz_vmr *filter, const AM_MEDIA_TYPE case 32: info.Format = D3DFMT_X8R8G8B8; break; default: FIXME("Unhandled bit depth %u.\n", filter->bmiheader.biBitCount); + free(filter->surfaces); return E_INVALIDARG; }
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) @@ -457,6 +460,7 @@ static HRESULT allocate_surfaces(struct quartz_vmr *filter, const AM_MEDIA_TYPE } }
+ free(filter->surfaces); return hr; }