[PATCH 7/7] mfplat: Prevent use after free (Coverity)

Nikolay Sivov nsivov at codeweavers.com
Sat Apr 23 16:19:14 CDT 2022


On 4/23/22 21:17, Fabian Maurer wrote:
> Signed-off-by: Fabian Maurer <dark.shadow4 at web.de>
> ---
>   dlls/mfplat/mediatype.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c
> index 71d55e2d232..a05fec9ad43 100644
> --- a/dlls/mfplat/mediatype.c
> +++ b/dlls/mfplat/mediatype.c
> @@ -1380,6 +1380,7 @@ static const WAVEFORMATEX * WINAPI audio_mediatype_GetAudioFormat(IMFAudioMediaT
>               &size, MFWaveFormatExConvertFlag_Normal)))
>       {
>           WARN("Failed to create wave format description, hr %#lx.\n", hr);
> +        media_type->audio_format = 0;
>       }
>
>

This makes sense, but let's reset it after CoTaskMemFree(), and use NULL 
as it's more common for null pointers. Same issue with GetVideoFormat().



More information about the wine-devel mailing list