From 3c52e3dd7c806d349332fb22f3743891ed6be2a8 Mon Sep 17 00:00:00 2001 From: Eric Brown Date: Fri, 2 Mar 2018 12:39:28 -0600 Subject: [PATCH] Fix H.264 codec init access violation on Windows N/KN systems --- libfreerdp/codec/h264_mf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libfreerdp/codec/h264_mf.c b/libfreerdp/codec/h264_mf.c index 84f3cb9..a892d46 100644 --- a/libfreerdp/codec/h264_mf.c +++ b/libfreerdp/codec/h264_mf.c @@ -494,12 +494,15 @@ static BOOL mf_init(H264_CONTEXT* h264) if (!sys) goto error; - h264->pSystemData = (void*) sys; /* http://decklink-sdk-delphi.googlecode.com/svn/trunk/Blackmagic%20DeckLink%20SDK%209.7/Win/Samples/Streaming/StreamingPreview/DecoderMF.cpp */ sys->mfplat = LoadLibraryA("mfplat.dll"); - if (!sys->mfplat) + { + free(sys); goto error; + } + + h264->pSystemData = (void*) sys; sys->MFStartup = (pfnMFStartup) GetProcAddress(sys->mfplat, "MFStartup"); sys->MFShutdown = (pfnMFShutdown) GetProcAddress(sys->mfplat, "MFShutdown"); -- 2.7.4