intel / libvpl

Intel® Video Processing Library (Intel® VPL) API, dispatcher, and examples
https://intel.github.io/libvpl/
MIT License
275 stars 84 forks source link

Calling SetCurrentDirectory during MFXEnumImplementations is unsafe #101

Closed jeremy-visionaid closed 1 year ago

jeremy-visionaid commented 1 year ago

MFXEnumImplementations calls SetCurrentDirectory through LoaderCtxVPL::SearchDirForLibs: https://github.com/oneapi-src/oneVPL/blob/e12ace9761bb52786409e830f619916b86e87fc5/dispatcher/vpl/mfx_dispatcher_vpl_loader.cpp#L174

Unfortunately, SetCurrentDirectory affects the entire processes, causing other threads to fail if they expect the current directory to remain unchanged. i.e. it's not OK for a library to call this function since it's not reasonable to assume no other threads are running.

jonrecker commented 1 year ago

Thank you. This call will be removed in the next release.

jeremy-visionaid commented 1 year ago

That's great, thanks for the quick response!

mav-intel commented 1 year ago

Fixed in 55f649039dd1061bb617e84e7ad762aa8ed4341b