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
414 stars 94 forks source link

Audio device changed may kill application #300

Closed ybbahg closed 5 months ago

ybbahg commented 5 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 5 months ago

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