Bug 1243627 - FFVPXRuntimeLinker::Init() should set sLinkStatus to LinkStatus_FAILED before returning false. r=jya.
--- a/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
+++ b/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
@@ -38,16 +38,17 @@ MozAVLink(const char* aName)
/* static */ bool
FFVPXRuntimeLinker::Init()
{
if (sLinkStatus) {
return sLinkStatus == LinkStatus_SUCCEEDED;
}
MOZ_ASSERT(NS_IsMainThread());
+ sLinkStatus = LinkStatus_FAILED;
// We retrieve the path of the XUL library as this is where mozavcodec and
// mozavutil libs are located.
char* path =
PR_GetLibraryFilePathname(XUL_DLL, (PRFuncPtr)&FFVPXRuntimeLinker::Init);
if (!path) {
return false;
}
@@ -80,18 +81,16 @@ FFVPXRuntimeLinker::Init()
if (libname) {
sFFVPXLib.mAVCodecLib = MozAVLink(libname);
PR_FreeLibraryName(libname);
}
if (sFFVPXLib.Link()) {
sLinkStatus = LinkStatus_SUCCEEDED;
return true;
}
- sLinkStatus = LinkStatus_FAILED;
-
return false;
}
/* static */ already_AddRefed<PlatformDecoderModule>
FFVPXRuntimeLinker::CreateDecoderModule()
{
if (!Init()) {
return nullptr;