diff --git a/libfreerdp/codec/h264.c b/libfreerdp/codec/h264.c index 77773102a..357465d8f 100644 --- a/libfreerdp/codec/h264.c +++ b/libfreerdp/codec/h264.c @@ -468,7 +468,7 @@ BOOL h264_context_init(H264_CONTEXT* h264) for (i = 0; i < MAX_SUBSYSTEMS; i++) { H264_CONTEXT_SUBSYSTEM* subsystem = subSystems[i]; - if (!subsystem->Init) + if (!subsystem || !subsystem->Init) break; if (subsystem->Init(h264)) diff --git a/libfreerdp/codec/h264_mf.c b/libfreerdp/codec/h264_mf.c index 7037ca75a..69a149b42 100644 --- a/libfreerdp/codec/h264_mf.c +++ b/libfreerdp/codec/h264_mf.c @@ -517,10 +517,12 @@ static BOOL mf_init(H264_CONTEXT* h264) "MFCreateMediaType"); sys->MFCreateDXGIDeviceManager = (pfnMFCreateDXGIDeviceManager) GetProcAddress( sys->mfplat, "MFCreateDXGIDeviceManager"); - + /** + * Note: MFCreateDXGIDeviceManager is supported starting from Windows 8. + * Don't fail below if GetProcAddress returned NULL. + */ if (!sys->MFStartup || !sys->MFShutdown || !sys->MFCreateSample - || !sys->MFCreateMemoryBuffer || - !sys->MFCreateMediaType || !sys->MFCreateDXGIDeviceManager) + || !sys->MFCreateMemoryBuffer || !sys->MFCreateMediaType) goto error; CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);