1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

winegstreamer: Fix a memory leak (Coverity).

video_format can be leaked when encountering an invalid WMV format.
This commit is contained in:
Zhiyi Zhang 2023-12-02 23:10:55 +08:00 committed by Alexandre Julliard
parent 93db373c28
commit c1fa6be453

View file

@ -625,9 +625,6 @@ static bool amt_from_wg_format_video_wmv(AM_MEDIA_TYPE *mt, const struct wg_form
uint32_t frame_time;
const GUID *subtype;
if (!(video_format = CoTaskMemAlloc(sizeof(*video_format))))
return false;
switch (format->u.video_wmv.format)
{
case WG_WMV_VIDEO_FORMAT_WMV1:
@ -650,6 +647,9 @@ static bool amt_from_wg_format_video_wmv(AM_MEDIA_TYPE *mt, const struct wg_form
return false;
}
if (!(video_format = CoTaskMemAlloc(sizeof(*video_format))))
return false;
mt->majortype = MEDIATYPE_Video;
mt->subtype = *subtype;
mt->bFixedSizeSamples = FALSE;