Bug 1856301: [OpenBSD] also preload libavcodec.so before sandboxing r=gerard-majax

With the current sandboxing configuration, FFmpegRuntimeLinker::Init()
can't access libavcodec.so, so video decoding fails in the RDD process
and fallbacks to the content process.

With media.allow-audio-non-utility knob (from bug #1850904) toggled
to false enforcing audio decoding in the Utility process, this has the
side effect of enforcing video decoding in the RDD process, and thus
video decoding fails.

Preloading libavcodec.so like it was done for libmozavcodec.so and
libmozavutil.so in bug #1713745 fixes it, as the second dlopen() call
hits the ld.so cache and returns the preloaded library handle.

replaces/supersedes https://phabricator.services.mozilla.com/D190475

Differential Revision: https://phabricator.services.mozilla.com/D193353
This commit is contained in:
Landry Breuil
2023-11-14 05:56:32 +00:00
parent 67d4591e1b
commit 6ed46667e6

View File

@@ -31,6 +31,7 @@ bool RDDProcessImpl::Init(int aArgc, char* aArgv[]) {
#elif defined(__OpenBSD__) && defined(MOZ_SANDBOX)
PR_LoadLibrary("libmozavcodec.so");
PR_LoadLibrary("libmozavutil.so");
PR_LoadLibrary("libavcodec.so");
StartOpenBSDSandbox(GeckoProcessType_RDD);
#endif
Maybe<const char*> parentBuildID =