sskodje / ScreenRecorderLib

A .NET library for screen recording in Windows, using native Microsoft Media Foundation for realtime encoding to h264 video or PNG images.
MIT License
408 stars 93 forks source link

Audio device changed may kill application #300

Closed ybbahg closed 3 months ago

ybbahg commented 4 months ago

Hi @sskodje

I'd like to report an issue that application crash ScreenRecorderLibNative::CoreAudio.util contains HRESULT GetAudioDeviceFriendlyName(_In_ IMMDevice *pDevice, _Out_ std::wstring *deviceName){...} and varString.pwszVal might be NULL so *deviceName = std::wstring(varString.pwszVal); might go crash Not all my machines but several ones have this issue. So NULL check may need

thanks

sskodje commented 4 months ago

Thanks for letting me know, i'll add a null check