Module: wine Branch: stable Commit: 5d0795bb4192c92244e88cd54ae604278a6e57b6 URL: https://gitlab.winehq.org/wine/wine/-/commit/5d0795bb4192c92244e88cd54ae6042...
Author: Fabian Maurer dark.shadow4@web.de Date: Tue Apr 26 21:03:22 2022 +0200
mfplat: Prevent use after free (Coverity).
Signed-off-by: Fabian Maurer dark.shadow4@web.de Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit f5d41f28f6442bd7e074efa17785b40ad3c65ba4) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/mfplat/mediatype.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 4f24ccbd237..26295a254b2 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -978,6 +978,7 @@ static const MFVIDEOFORMAT * WINAPI video_mediatype_GetVideoFormat(IMFVideoMedia TRACE("%p.\n", iface);
CoTaskMemFree(media_type->video_format); + media_type->video_format = NULL; if (FAILED(hr = MFCreateMFVideoFormatFromMFMediaType(&media_type->IMFMediaType_iface, &media_type->video_format, &size))) WARN("Failed to create format description, hr %#x.\n", hr);
@@ -1378,6 +1379,7 @@ static const WAVEFORMATEX * WINAPI audio_mediatype_GetAudioFormat(IMFAudioMediaT TRACE("%p.\n", iface);
CoTaskMemFree(media_type->audio_format); + media_type->audio_format = NULL; if (FAILED(hr = MFCreateWaveFormatExFromMFMediaType(&media_type->IMFMediaType_iface, &media_type->audio_format, &size, MFWaveFormatExConvertFlag_Normal))) {