Commit 1be02b2b authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

winegstreamer: Fix memory leak in get_available_media_type (Coverity).

parent 1f1713b0
......@@ -269,15 +269,15 @@ static HRESULT get_available_media_type(DWORD index, IMFMediaType **type, BOOL o
const GUID *subtype;
HRESULT hr;
if (FAILED(hr = MFCreateMediaType(&media_type)))
return hr;
*type = NULL;
if (index >= (output ? 2 : 1) * ARRAY_SIZE(audio_formats))
return MF_E_NO_MORE_TYPES;
subtype = audio_formats[index % ARRAY_SIZE(audio_formats)];
if (FAILED(hr = MFCreateMediaType(&media_type)))
return hr;
if (FAILED(hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio)))
goto done;
if (FAILED(hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, subtype)))
......
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